It's Christmas Eve and you've left all of your wrapping to the last minute. You have to wrap presents for children named Bob, Bill, Barrie, Bart, Brandon, Bernadette and Bertha. They all wanted to get one toy train. You meant to buy one toy train for each child but accidentally bought double the amount of trains necessary. You begin by putting one train into each child's gift basket so that each child will be happy on Christmas morning. After that you got lazy and decided to put the remaining toys in any gift basket you wanted. There are N number of ways to put the remaining trains in the baskets. What are the last three digits of N ?
Details and assumptions
The toy trains are identical to each other.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I think your answer is wrong. We can use the stars~bars method only when all the baskets are not distinguishable but here since the baskets belong to the different people with different names we cannot apply that.
Each of the 7 remaining trains has 7 possibilities (they can go into seven different baskets) thus there are 7^7 ways == 823543 ways
Tell me if I am wrong ??
Log in to reply
It would be 7^7 if the trains were distinguishable. But since the trains are identical, doing 7^7 would over count.
sheryash is very right,ur ans would have been correct if they are distinct.........................cause when objects are same what matters is the no of ways sum 7 can be attained..........
What Shreyas said is correct. Though there are different baskets, the trains are indistinguishable, we CAN use Stars and Bars.
I thought so too! Once he's got them all in their baskets, it's just a matter of asking how many ways he can randomly put the remaining seven in the seven bags. But remember, that would count, say, 2 in the first, 1 in the second, and 4 in the fifth different than 2 in the first, 1 in the second, and 4 in the fifth BUT WITH DIFFERENT TRAINS. But they're indistinguishable.
didn't get that ,stars and bars method why not 7! ways
santanu, i think using binary notation will help
if trains are distinct and that you are so lazy that you literally put the remaining 7 trains in "ANY gift basket", i.e a particular basket may get 0 to 7 trains 7 ways for each train, thus 7^7 = 823543
Damn it....I got 1716 and didnt read that we have to enter only the last three digits...my fault!!!
The problem is to distribute 1 4 toy trains among 7 children Bob, Bill, Barrie, Bart, Brandon, Bernadette and Bertha. The value of N is the number of solution of the equation b 1 + b 2 + b 3 + b 4 + b 5 + b 6 + b 7 = 1 4 where b i ≥ 1 for i = 1 , … , 7 .
So, N = ( 1 4 − 1 ) C ( 7 − 1 ) = 1 7 1 6 .
Answer is 7 1 6
There are seven children and we bought twice the amount of (identical) trains necessary, so we got 1 4 trains. In the first round, we give everyone 1 train each, and since they are identical, it doesn't make a difference which train we gave whom. Now we have 7 trains. We randomly distribute this to the children.
Hmm, so we have 7 children, and 7 trains. We distribute the 7 trains randomly. Sounds a lot like the famous stars and bars problem. Let the seven trains be the stars and let the bars represent which child gets what. So, one possible configuration is
*|*||**|**|*||
The figure above excludes only the extra seven trains. Initially, every child got 1 identical train. So, in the figure above,
Other configurations like
****|*|*|*||||
are also possible. The number of possible configurations is given by ( k n + k − 1 ) where n is the number of bars and k are the number of stars.
Now, in our example, n = 7 and k = 7 . Thus, our answer is ( 7 7 + 7 − 1 ) = 1 7 1 6 and the last three digits of this number are 7 1 6 .
but cant we say that the 1st present can go to 7 boxes , the second can also go into 7 boxes and so on.. that should give us 7^7
what is wrong with this approach?
why do we need to subtract 1 from the n+k? i don't get it up til now... can you please teach me this stars and bars problem
Pretend like we have each train in a row. So we have a row of 14 trains. There are 13 total spaces between the trains.
Say we also have 6 random sticks that we took from the Christmas tree. If we place all 6 sticks in the 13 spaces, we've immediately divided all 14 trains among the 7 children, and each child gets at least one train. (What each child gets is equal to the number of trains before or after each stick, or between the set of sticks.)
Therefore, N = ( 6 1 3 ) = 1 7 1 6 So the answer is 7 1 6
It's not necessarily that each bi is more than or equal to 1.
Direct formula to put N things in R bags is C (N+R-1,R-1).
In this case, N=7, R=7, So, 13C6 = 1716.
Last 3 digits = 716
after putting 7 ,7 left so equavalent to no of ways of attaining sum=7,no of 13c7=1716 so reqd ans=176
remaining toy = 7
ways to put remaining trains toy in the baskets is 13C6 = 1716
so the last three digits of N is 716
Problem Loading...
Note Loading...
Set Loading...
There are 7 children, and you've mistakenly bought 2 × 7 = 1 4 toy trains. Now, you put one toy train into each child's gift basket, that is you have put 7 toy trains and you are thus left with 7 toy trains. Now that your lazy mode is on, you have to randomly put the remaining 7 toy trains into 7 gift baskets. It is the same as dividing 7 stars by 7 bars. So, by stars and bars method, we can get the total number of ways in which this can be done = ( 7 − 1 7 + 7 − 1 ) = ( 6 1 3 ) = 1 7 1 6 = N . Since the questions ask for the last three digits of N , our answer is 7 1 6 .