Jump to content

Talk:Combinations with repetitions: Difference between revisions

(→‎How about this definition?: More opinions ...)
Line 84:
 
:I think we have two separate tasks here. We have the original task (where individual items could be repeated with counts independent of other items) and the new task (where the repetition count on all items is assumed to be at least as large as the number of elements in the desired results). --[[User:Rdm|Rdm]] 15:58, 19 November 2010 (UTC)
 
:: And yet I get the n=10, k=3 result of 220 which is mentioned in the Wikipedia article?
 
:: Looking again at the [http://rosettacode.org/mw/index.php?title=Combinations_with_repetitions&oldid=95620 previous description] of:
:::Write a program which generates the all [[wp:Combination|k-combination with repetitions]] of '''n''' different objects. (Practically numerals!)
 
:::An example about the task:
:::You have a hat, and you have '''n''' balls with numbers (1...n). Put the balls into the hat, and cover it. Take '''k'''-times one ball from the hat, but you must put back always immediately the ball after registration of the number into the hat. How many different combination can we have? (Of course the following two combination are not different: [1, 2, 2] and [2, 1, 2]).
 
::And comparing it to the new doughnut flavoured task of:
::::Q: How many ways can a person choose two doughnuts from a store selling three types of doughnut: iced, jam, and plain?
 
::::A: 6: iced and iced; iced and jam; iced and plain; jam and jam; jam and plain; plain and plain.
 
::I think the task descriptions are equivalent but the old J solution confuses me as it shows fixed repetitions of items, where I read the WP article and the description given as needing only the n types of allowable items - any kind of repetition (or omission), is allowed just so long as only k are chosen at once. Yep, it doesn't help that the wp article is hard to read :-)
:: --[[User:Paddy3118|Paddy3118]] 17:00, 19 November 2010 (UTC)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.