mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Puzzles (https://www.mersenneforum.org/forumdisplay.php?f=18)
-   -   A small puzzle (https://www.mersenneforum.org/showthread.php?t=20703)

Dubslow 2015-11-28 10:56

A small puzzle
 
Here's a no doubt not-terribly-difficult problem, but it's not exactly trivial. I have little interest in actually solving it, so here it is for the forum's
enjoyment:

Given a target n and a count c, how many different ways are there for `c` integers to sum to `n`?

For instance, with n=11 and c=4, the total is eleven:
[code](1, 1, 1, 8)
(1, 1, 2, 7)
(1, 1, 3, 6)
(1, 1, 4, 5)
(1, 2, 2, 6)
(1, 2, 3, 5)
(1, 2, 4, 4)
(1, 3, 3, 4)
(2, 2, 2, 5)
(2, 2, 3, 4)
(2, 3, 3, 3)[/code]

axn 2015-11-28 11:15

[url]https://en.wikipedia.org/wiki/Partition_%28number_theory%29#Restricted_part_size_or_number_of_parts[/url]

Dubslow 2015-11-28 11:54

[QUOTE=axn;417474][url]https://en.wikipedia.org/wiki/Partition_%28number_theory%29#Restricted_part_size_or_number_of_parts[/url][/QUOTE]

Ah. Well I wasn't wrong :smile: (rather, my google queries into the matter were ignorant of the extant terminology)

retina 2015-11-28 15:00

[QUOTE=Dubslow;417472]Given a target n and a count c, how many different ways are there for `c` integers to sum to `n`?

For instance, with n=11 and c=4, the total is eleven:
[code](1, 1, 1, 8)
(1, 1, 2, 7)
(1, 1, 3, 6)
(1, 1, 4, 5)
(1, 2, 2, 6)
(1, 2, 3, 5)
(1, 2, 4, 4)
(1, 3, 3, 4)
(2, 2, 2, 5)
(2, 2, 3, 4)
(2, 3, 3, 3)[/code][/QUOTE]The puzzle as stated has an infinite number of solutions.

So your puzzle in return it is discover why it has in infinite number of solutions.

Dubslow 2015-11-28 15:31

[QUOTE=retina;417493]The puzzle as stated has an infinite number of solutions.

So your puzzle in return it is discover why it has in infinite number of solutions.[/QUOTE]

Do you perhaps refer to my lack of specifying strictly positive integers?

Uncwilly 2015-11-28 15:42

[QUOTE=Dubslow;417494]Do you perhaps refer to my lack of specifying strictly positive integers?[/QUOTE]
Your original post did not specify that. BTW there is a term specifically for them "natural numbers".

LaurV 2015-11-28 16:13

[deleted]
sorry, ignore this, I didn't read to the end

davar55 2015-11-28 16:27

[QUOTE=LaurV;417504][deleted]
sorry, ignore this, I didn't read to the end[/QUOTE]
oops, me too, started to jump in too soon.
typical.

:smile:

davar55 2015-11-28 16:31

[QUOTE=Uncwilly;417497]Your original post did not specify that. BTW there is a term specifically for them "natural numbers".[/QUOTE]

The naturals are 1,2,3,..., and don't usually include 0.
The axiomatic approach begins with 0 and a successor rule.
By starting with 0, instead of 1, it's easier to define the
arithmetic operations.

Uncwilly 2015-11-28 17:05

[QUOTE=davar55;417507]The naturals are 1,2,3,..., and don't usually include 0.[/QUOTE]The way that I was taught "natural numbers" and "whole numbers" were differentiated by 0 being in one and not the other. Trying to reconfirm before posting led to some confusion. The way I recall:
[[[[[whole]natural]integers]rational]+[irrational]]=[real]
[imaginary]

science_man_88 2015-11-28 17:16

[QUOTE=Dubslow;417472]but it's not exactly trivial. [/QUOTE]


[CODE]partitions(n,,[c,c])[/CODE] in PARI would work


All times are UTC. The time now is 05:34.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.