WATCH |
2 pages [ << < ( 1 ) 2 NEXT >> ] 1264 views | Post Reply |
RunRyder | RunRyder |
![]() |
![]() |
Vance
rrVeteran York ,PA |
permutation calculator OK smart guys.
I need to find out how many different combinations can be had with 5 different items in a 50 lot. I have 5 boxes that can fit into a shipper. The shipper can hold 50 boxes total. How many variations does that come out to be? I tried looking for an online calculator but couldn't find one. Thanks Vince D |
SHARE PM EMAIL HOMEPAGE GALLERY Attn:RR Quote |
Vance
rrVeteran York ,PA |
Can anyone confirm? |
SHARE PM EMAIL HOMEPAGE GALLERY Attn:RR Quote |
![]() rrProfessor Orlando Florida ...28N 81W |
![]() |
SHARE PM EMAIL GALLERY Attn:RR Quote |
Vance
rrVeteran York ,PA |
Think "The Sweetest Place On Earth" I have 5 diff boxes of candy. Hershey's: Milk Milk W/Almonds KitKat Reese peanut Butter Cup 24ct carton Reese PBC 6ct carton.The marketing dep't is asking me to fit these cartons into a shipper that will hold Roughly, 50 cartons. I need to respond to them to let them know that there are literally millions of combinations of the above product that can fit into the unit. Roughly- 2 million combinations by my calculations. |
SHARE PM EMAIL HOMEPAGE GALLERY Attn:RR Quote |
nitro fun
rrApprentice Oc ca |
|
SHARE PM EMAIL GALLERY Attn:RR Quote |
JakeBrake
rrNovice oHIo |
|
SHARE PM EMAIL GALLERY Attn:RR Quote |
Vance
rrVeteran York ,PA |
MWA-9 KK-9 Reeses PBC 24ct-7 Reese PBC 36ct-15Milk-9 MWA-8 KK-9 Reeses PBC 24ct-8 Reese PBC 36ct-15Milk-9 MWA-8 KK-9 Reeses PBC 24ct-9 Reese PBC 36ct-14Milk-7 MWA-8 KK-9 Reeses PBC 24ct-10 Reese PBC 36ct-14Oh- & I have literally hundreds of cases of Hershey candy in my office. I give it out to friends, family, postman,Etc. & my daughter's daycare. They love me at her daycare as I give them candy & then they're all jacked up on chocolate the rest of the day. |
SHARE PM EMAIL HOMEPAGE GALLERY Attn:RR Quote |
![]() rrProfessor Orlando Florida ...28N 81W |
Sorry, don't have an answer for you, wish I did, I would request free samples for the answer. |
SHARE PM EMAIL GALLERY Attn:RR Quote |
![]() rrProfessor Orlando Florida ...28N 81W |
Or: (50X5)+(50X4)+(50X3)+(50X2)+50 ?It's something like that. |
SHARE PM EMAIL GALLERY Attn:RR Quote |
Mark C
rrKey Veteran Houston, TX - USA |
![]() ![]() 211876 is the correct answer and only includes combinations that add to 50. had an error in my equations ![]() |
SHARE PM EMAIL GALLERY Attn:RR Quote |
homer
rrNovice Gainesville - Florida |
No- I'm at work.
Think "The Sweetest Place On Earth" I have 5 diff boxes of candy. Hershey's: Milk Milk W/Almonds KitKat Reese peanut Butter Cup 24ct carton Reese PBC 6ct carton.The marketing dep't is asking me to fit these cartons into a shipper that will hold Roughly, 50 cartons. I need to respond to them to let them know that there are literally millions of combinations of the above product that can fit into the unit. Roughly- 2 million combinations by my calculations. |
SHARE PM EMAIL Attn:RR Quote |
Vance
rrVeteran York ,PA |
I can hear the people screaming from riding the roller coasters & I've been known to wander over there after lunch for a ride on a coaster. You definitely don't have to worry about falling asleep in the afternoon after a 60mph ride on one of those. |
SHARE PM EMAIL HOMEPAGE GALLERY Attn:RR Quote |
homer
rrNovice Gainesville - Florida |
|
SHARE PM EMAIL Attn:RR Quote |
jphilli
rrKey Veteran Atlanta, Ga. |
IIII00000000000000000000000000000000000000000000000000Here we ran into a problem because in order for us to be able to count the number of combinations easily, the I's must not touch other I's. So to resolve this, we add to the string of 0's an additional 5 0's.0000000000000000000000000000000000000000000000000000000With 55 0's and 4 dividers, let's look at an example where we would only send out 4 types of candy.0000000I0000000I0000000000000I0000000000000000000000I0Here we see that x1=7, x2=7, x3=13, x4=22 and x5=1. But we must subtract 1 from each variable to get the true number of contents in the shipper.Now the problem is very easy to count. With 55 0's and 54 spaces between those 0's, we need to distribute 4 I's. So 54 choose 4 = 54!/4!/50! = 316251.Hope I explained it well enough guys. For what it's worth, I'm an applied math major at Ga. Tech so I have a little bit of experience with combinatorics. |
SHARE PM EMAIL Attn:RR Quote |
Vance
rrVeteran York ,PA |
![]() I took a big bag of it to the gym tonight & walked into a spin class in progress & handed the instructor a big bag of candy & said "spin this off". She's a friend so we all had a good laugh about it. The ladies love the chocolate & you'd be surprised what they will do for some ![]() Vince D |
SHARE PM EMAIL HOMEPAGE GALLERY Attn:RR Quote |
jphilli
rrKey Veteran Atlanta, Ga. |
![]() |
SHARE PM EMAIL Attn:RR Quote |
Mark C
rrKey Veteran Houston, TX - USA |
int iTotal = 0;for (iBox1 = 1; iBox1 <= 46; iBox1++) for (iBox2 = 1; iBox2 <= (50-1-1-iBox1); iBox2++) for (iBox3 = 1; iBox3 <= (50-1-iBox1-iBox2); iBox3++) for (iBox4 = 1; iBox4 <= (50-iBox1-iBox2-iBox3); iBox4++) { iBox5 = 50 - (iBox1 + iBox2 + iBox3 + iBox4); if (iBox5 > 0) iTotal++; }textBox1.Text = iTotal.ToString();Mark C. |
SHARE PM EMAIL GALLERY Attn:RR Quote |
jphilli
rrKey Veteran Atlanta, Ga. |
|
SHARE PM EMAIL Attn:RR Quote |
Mark C
rrKey Veteran Houston, TX - USA |
Mark, the difference is that you assumed that the minimum quantity per candy type is one and I took it as zero. Yes, your answer is correct for a min. of 1 as I checked that. However I didn't get the impression that there was a minimum number of various types of candy that must be present. for (iBox2 = 0; iBox2 <= (50-iBox1); iBox2++) for (iBox3 = 0; iBox3 <= (50-iBox1-iBox2); iBox3++) for (iBox4 = 0; iBox4 <= (50-iBox1-iBox2-iBox3); iBox4++) iTotal++;And the answer is indeed 316251 .... same as yours ![]() Out of curiosity, how long did it take your code to run through all the possibilities? I've done that sort of thing in the past but I've found that the combo. approach when dealing with large numbers to be signifigantly faster. |
SHARE PM EMAIL GALLERY Attn:RR Quote |
GimbalFan (RIP)
rrProfessor Big Coppitt Key, FL |
![]() |
SHARE PM EMAIL GALLERY Attn:RR Quote |
WATCH |
2 pages [ << < ( 1 ) 2 NEXT >> ] 1264 views | Post Reply |
RunRyder | RunRyder |
![]() |
![]() |
Saturday, January 16 - 5:32 pm - Copyright © 2000-2021 RunRyder EMAIL • Enable Cookies