Talk:Count the coins/0-1: Difference between revisions

 
(15 intermediate revisions by 3 users not shown)
Line 10:
Can you show an algorithm? --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 07:09, 6 January 2021 (UTC)
 
I will provide an algirithmalgorithm but I think it is not optimal in term of complexity and it is why I don't want it becomes the main implementation. --[[User:Blek|Blek]] ([[User talk:Blek|talk]]) 16:3044, 6 January 2021 (UTC)
 
==Several problems==
Line 21:
 
--[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 11:13, 6 January 2021 (UTC)
 
:The order matters means 1 + 5 is different of 5 + 1. --[[User:Blek|Blek]] ([[User talk:Blek|talk]]) 16:32, 6 January 2021 (UTC)
 
::We already have a task for finding all permutations of 1 and 5.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 16:50, 6 January 2021 (UTC)
 
::Why would you want to count [1,2,3] as either 4 ("order unimportant") or 24 ("order important") different ways to get 6 - which is what '''all''' of the solutions so far do for the middle case ...??!! --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 17:29, 7 January 2021 (UTC)
 
==Duplicate Task?==
Although written in English they look very different, logically this and [[Subset_sum_problem]] are the same task. For an algorithm you could try https://academyera.com/sum-of-subsets-problem#:~:text=sum%20of%20subsets%20problem%20is%20nothing%20but%20Suppose,set%20whose%20sum%20adds%20to%20a%20number%20K.
 
:I checked, they are different. They are different in many ways. At least you may have duplicated elements in the list of coins. --[[User:Blek|Blek]] ([[User talk:Blek|talk]]) 16:39, 6 January 2021 (UTC)
 
::Call the first coin 'alliance', the second coin 'archbishop', the third coin 'balm' etc. Write them in a list and they are exactly the same!!!!--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 16:44, 6 January 2021 (UTC)
 
:::The problem you are talking about want a set for an answer thus the order doesn't matter. Also has a set as input. Furthermore the current problem allows to generalize if you are allowed to take up to k coins my multiplying them in the list. --[[User:Blek|Blek]] ([[User talk:Blek|talk]]) 16:56, 6 January 2021 (UTC)
 
::::'archbishop' and 'balm' could both have value 5. Ordering here just means find all permutations of a solution. We have a task for finding all permutations of a set.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 17:07, 6 January 2021 (UTC)
::::Here I am looking for an number as ouput and the problem you are talking about wants a set. Let say it is minor difference. The order matters here while it doesn't in the problem you are talking about. Let say also it is a minor difference. The target sum is always zero in the problem you are talking when it may change here. Let say also it is minor difference. Want zero as sum may cause algorithms to use the idea to split set in 2 sets (negative and positive numbers) not easily transferable in this case. Let say it is a minor difference. I won't say many minor differences give a minor difference. --[[User:Blek|Blek]] ([[User talk:Blek|talk]]) 17:27, 6 January 2021 (UTC)
: It is also very similar to [[Permutations_with_some_identical_elements]] with one extra condition. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 22:32, 6 January 2021 (UTC)
7,796

edits