March 22nd, 2011, 04:03 PM #1 Newbie   Joined: Mar 2011 Posts: 4 Thanks: 0 permutation of a sum of ranges Hi, How to find the permutations/combinations of the possible values of items such as the sum of these is constant, but each item's value may vary in the range 0-20? F.ex: [color=#800040]A1(0-20)+A2(0-20)+A3(0-20)+A4(0-20)=constant(20)[/color] I could only get the problem down to: [color=#800000]A1(0-20)+A2(0-20)=20 [/color] and the combinations/permutations (not even sure what it is about exactly, cause when A1 goes to 20, A2 goes down to 0) are obviously 20, derived just from intuitive logic. Cannot think off a way to utilize the formulas for combinations/permutations [color=#400040]P(n, r) = n!/(n - r)!, C(n, r) = n!/r!(n - r)![/color] Best Regards March 23rd, 2011, 12:08 AM #2 Senior Member   Joined: Feb 2009 From: Adelaide, Australia Posts: 1,519 Thanks: 3 Re: permutation of a sum of ranges You mean 21, because the first number will be 0-20 and the second number 20-0, and there are 21 possibilities. In general, if you need two non-negative integers to sum to N, there will be N+1 ways. So if you have four numbers, you can look at them as two pairs. If the first pair sums to 20 (in 21 ways), the second pair sums to 0 (in 1 way). If the first pair sums to 19 (in 20 ways), the second pair sums to 1 (in 2 ways). If the first pair sums to 18 (in 19 ways), the second pair sums to 2 (in 3 ways). ... 21*1 + 20*2 + 19*3 + 18*4 + ... + 11*11 + ... + 4*18 + 3*19 + 2*20 + 1*21 = (21 + 40 + 57 + 72 + 85 + 96 + 105 + 112 + 117 + 120) * 2 + 121 = 825*2 + 121 = 1771 I could give you a general formula (for four numbers) if you need one. March 23rd, 2011, 01:55 AM #3 Newbie   Joined: Mar 2011 Posts: 4 Thanks: 0 Re: permutation of a sum of ranges Formula with something! factorial? Still cant get it. Represented as sets isn't it rather: {20,0},{19,1},{18,2},{17,3},{16,4},{15,5},{14,6},{ 13,7},{12,8},{11,9}, {10,10},{9,11},{8,12},{7,13},{6,14},{5,15},{4,16}, {3,17},{2,18},{1,19}, {0,20} = 21 sets, ok I get that a + b = N in N + 1 ways but still.. Why do you multiply them? Also each item should occupy once the range 0-20: A1(0-20), A2(0-20)... So when you combine the results of these 2x2 pairs, what exactly is going on? maybe a formula for n items that sum up to N, as: I(n-(n-1)) + I(n-(n-2)) + ... + I(n) = N March 23rd, 2011, 02:07 AM #4 Senior Member   Joined: Feb 2009 From: Adelaide, Australia Posts: 1,519 Thanks: 3 Re: permutation of a sum of ranges Suppose the first two sum to 18. There are 19 ways it could happen: 18+0 17+1 16+2 etc Then for each of the ways it could happen, there are 3 ways the other two could sum to 2. So you would have 18+0 + 2+0 18+0 + 1+1 18+0 + 0+2 17+1 + 2+0 17+1 + 1+1 17+1 + 0+2 16+2 + 2+0 16+2 + 1+1 16+2 + 0+2 etc 19*3 ways March 23rd, 2011, 02:29 AM #5 Newbie   Joined: Mar 2011 Posts: 4 Thanks: 0 Re: permutation of a sum of ranges Got it more or less. Do we need an induction proof here? Is it mathematically correct to leave it like this for this particular case (4 items sum up to 20) or: It(1) + It(2) + ... + It(n) = N where It(0 ... N) a formula for n Items that sum up to N proved by induction Tags permutation, ranges, sum ### number a ways to get constant sum permutation

Click on a term to search for related topics.
 Thread Tools Show Printable Version Email this Page Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Similar Threads Thread Thread Starter Forum Replies Last Post kingkos Algebra 1 December 6th, 2012 01:39 PM kingkos Algebra 0 December 5th, 2012 11:43 AM panky Algebra 8 November 22nd, 2011 12:11 AM cyt_91 Advanced Statistics 1 January 29th, 2010 08:16 AM rabbithole Advanced Statistics 2 November 4th, 2008 06:43 AM

 Contact - Home - Forums - Cryptocurrency Forum - Top      