A construction worker is building a straight walking path that is 5m long from a client's front door to the sidewalk. The path is to be built out of planks that are 60 cm, 70cm, and 100 cm in length. How many different paths could be constructed using these plank lengths?
Details and assumptions
2 paths are different if the planks used are not in the same order. For example, the path constructing using planks 1 0 0 , 7 0 , 6 0 , 7 0 , 1 0 0 is different from the path constructed using planks 1 0 0 , 1 0 0 , 7 0 , 6 0 , 7 0 .
The worker has enough quantities of each different length of planks.
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.
Almost got it ouch!
How did u calculate number of ways to arrange (a,b,c) ?
We convert all lengths to centimeters. Let the number of 6 0 cm planks, the number of 7 0 cm planks, and the number of 1 0 0 cm planks be a , b , c respectively. Then we want to find the number of solutions to the equation 6 0 a + 7 0 b + 1 0 0 c = 5 0 0 where a , b , c are nonnegative integers. Dividing through by 1 0 gives 6 a + 7 b + 1 0 c = 5 0 . Considering parity, we see that 7 b must be even, which means that b must be even. So, write b = 2 b 1 for some nonnegative integer b 1 . Substituting and dividing by 2 , we have 3 a + 7 b 1 + 5 c = 2 5 . To limit the number of cases to check, note that 7 b 1 ≤ 2 5 , so b 1 ≤ 3 . We take cases on the value of b 1 :
If b 1 = 0 , then we have 3 a + 5 c = 2 5 . Checking all cases, we find that either ( a , c ) = ( 0 , 5 ) or ( 5 , 2 ) . This gives the ordered triples ( a , b , c ) = ( 0 , 0 , 5 ) , ( 5 , 0 , 2 ) .
If b 1 = 1 , then 3 a + 5 c = 1 8 . Checking through all possible values, we find that ( a , c ) = ( 1 , 3 ) or ( 6 , 0 ) . This case gives the triples ( a , b , c ) = ( 1 , 2 , 3 ) , ( 6 , 2 , 0 ) .
If b 1 = 2 , then 3 a + 5 c = 1 1 . Checking all cases gives only the solution ( a , c ) = ( 2 , 1 ) . So, another triple is ( a , b , c ) = ( 2 , 4 , 1 ) .
If b 1 = 3 , then 3 a + 5 b = 4 . There are no solutions in this case.
This is the last case to check. So, all of the possible triples ( a , b , c ) are ( 0 , 0 , 5 ) , ( 5 , 0 , 2 ) , ( 1 , 2 , 3 ) , ( 6 , 2 , 0 ) , ( 2 , 4 , 1 ) . We count the number of ways to order each arrangement of planks:
( 0 , 0 , 5 ) ⇒ c, c, c, c, c , so there is 1 way to order this.
( 5 , 0 , 2 ) ⇒ a, a, a, a, a, c, c , so there are 5 ! 2 ! 7 ! = 2 1 ways to order this.
( 1 , 2 , 3 ) ⇒ a, b, b, c, c, c which gives 3 ! 2 ! 6 ! = 6 0 orderings.
( 6 , 2 , 0 ) ⇒ a, a, a, a, a, a, b, b , which makes 6 ! 2 ! 8 ! = 2 8 possible orderings.
( 2 , 4 , 1 ) ⇒ a, a, b, b, b, b, c , so there are 4 ! 2 ! 7 ! = 1 0 5 possible ways to order this.
Thus, in total there are 1 + 2 1 + 6 0 + 2 8 + 1 0 5 = 2 1 5 ways to build the walking path.
Very clear solution, well done.
This problem can be easily solved using dynamic programming.
Let N ( L ) be the number of paths of length 1 0 L (Since everything is a multiple of 10, might as well cancel it off).
N ( l ) = 0 for l ≤ 6 except N ( 0 ) = 1 .
The recurrence for higher values of l is N ( l ) = N ( l − 6 ) + N ( l − 7 ) + N ( l − 1 0 )
This recurrence can be easily used to find N ( 5 0 ) :
L=50
N=[0 for i in range(L+1)]
N[0]=1
dl=[6,7,10]
for i in range(1,51):
for j in range(3):
if i>=dl[j]:
N[i]+=N[i-dl[j]]
print N[50]
This solution has generated a lot of interest in the topic of using computers to aid in solving the problem.
What happens if we replace the length 5m with the length 50m, or 500m? How would you solve the question then? The number of cases required to solve this using case analysis would be enormous. At what point do we say that the number of cases is too many and look for a different approach? 5? 10? 20? 50?
Would this be a problem in Data Structures and Algorithms , this would be a great solution. But it's Geometry and Combinatorics , so this problem is solvable without a computer.
Log in to reply
My way of thinking is that, if you get a provable, correct solution, it doesn't matter whether it was done by a human or a computer. Particularly in this case, I don't find the other case-by-case analysis solutions any more elegant.
Log in to reply
They're indeed not more elegant, but these problems are designed to be solved by hand. Many problems get way easier with the use of a computer.
Log in to reply
@Tim Vermeulen – Perhaps I am doing it wrong, but this is the way I think of Brilliant. I am given some challenges, and I need to solve them myself using tools I normally have with me - that is, without involving other people or any tool that I wouldn't normally have access to. That means I consider it fair game to code something myself (I think in terms of algorithms and implement it very fast, so that is a bonus), or use wolfram alpha or the like.
Log in to reply
@Raziman Thottungal Valapu – The problems in the mat olympiad section are designed to be solvable with pencil and paper, just like in math olympiads. There's often a beautiful crux move that is essential to solving a problem. Many of these problems become trivial when using a computer.
This indeed may be an elegant programming solution.
However, one of the aims of dynamic programming is about solving complex optimization problems. When the number of possibilities are in single digit, an optimal solution could be to list them down in less than 1 min by hand rather than write this program. When the number of possibilities run into significantly large number, a more appropriate place for this problem is "Data Structures Category". When it was posted in this (Geometry and Combinatorics) category, the intent is to train the faculty of the brain in this aspect as well.
When we go to gym, there are a number of exercises that are meant to develop different muscles in the body. Solving it using appropriate method could be regarded like this.
It is very much possible that you have solved this problem by the usual method and felt that more general solution that is applicable to any total length, any number of planks of any size. In that case, this is certainly a commendable piece of art!
Cheers.
I never thought this problem can be solved by programming idea
Kudos!It is nice to have one or two coding solutions lying around in the forums,for such problems.After solving by hand,I realized this problem reminded me of the Coin Sums Problem .So I coded a greedy algorithm for validation. Obviously DP is the more elegant solution here!Very nice!
Let the number of planks of lenth 60 cm , 70 cm , 100 cm are x , y , z respectively .
so,
0 ≤ x ≤ 8 < 6 0 5 0 0 = 6 5 0
0 ≤ y ≤ 7 < 7 0 5 0 0 = 7 5 0
0 ≤ z ≤ 1 0 0 5 0 0 = 5
now we can have our equation ,
60x + 70y + 100Z = 500
⇒ 6x + 7y + 10z = 50
⇒ 3x + 2 7 y +5z = 25
Now, from the equation we can see that 2 7 y must be an integer thus, y has to be an odd number .This makes our work a bit easy . Now we need to put the values in the equation and find out the integer solutions .
When , y = 0
3x + 5z = 25
⇒ 5 3 x + z = 5 , so, x has to be a multiple of 5 . so, x ∈ { 0 , 5 } . This gives us two triples : (0 , 0 , 5) and (5 , 0 , 2)
When , y = 2
6x + 10z = 36
⇒ x + 3 5 z = 6 ,
so, z has to be a multiple of 3 . so, z ∈ { 0 , 3 } . This gives us two triples : (6 , 2 , 0) and (1 , 2 , 3)
When , y = 4
6x + 10z = 22
⇒ 3x + 5z = 11 ,
so, the only triple solution that has integers is (2,4,1).
When , y = 6
6x + 10z = 8
And there is no integer solution in this case .
So, the 5 triples are (0 , 0 , 5) ; (5 , 0 , 2) ; (6 , 2 , 0) ; (1 , 2 , 3) ; (2 , 4 , 1) .
In this case the number of permutation = x ! y ! z ! ( x + y + z ) !
So the number of paths that can be constructed =
5 ! 5 ! + 5 ! 2 ! 7 ! + 6 ! 2 ! 8 ! + 2 ! 3 ! 6 ! + 2 ! 4 ! 7 ! = 215
Let the triplet (k,m,n) indicate the number of 60 cm planks, number of 70 cm planks and 100 cm planks respectively.Then they must satisfy
6k + 7m + 10n = 50.
Possible combinations are: (0,0,5), (5,0,2), (1,2,3), (6,2,0) (2,4,1)
For each combination, number possible ways of arranging planks is k ! m ! n ! ( k + m + n ) ! Sum of them is the required number of possibilities.
First, we convert to centimeters. 6 0 a + 7 0 b + 1 0 0 c = 5 0 0 Now, since 70 is the only odd, we can have 0,2, or 4 70 lengths. We do casework, and if there are at least 5 60s in one solution, we can subtract 5 from a and add 3 to c for another solution:
Case 1: b = 0
In this case, 6 0 a + 1 0 0 c = 5 0 0 It is easy to see ( 5 , 0 , 2 ) is one solution here, with 5 ! 2 ! 7 ! = 2 1 possibilities. Also, ( 0 , 0 , 5 ) works, with 1 possibility. There are 22 possibilities in this case.
Case 2: b = 2
In this case, 6 0 a + 1 0 0 c = 3 6 0 Again, there are two solutions. One is ( 6 , 2 , 0 ) , with 6 ! 2 ! 8 ! = 2 8 possibilities, and the other is ( 1 , 2 , 3 ) , with 3 ! 2 ! 1 ! 6 ! = 6 0 possibilities. There are 88 possibilities in this case.
Case 3: b = 4
In this case, 6 0 a + 1 0 0 c = 2 2 0 It is easy to see only ( 2 , 4 , 1 ) works here, so there are 4 ! 2 ! 1 ! 7 ! = 1 0 5 possibilities in this case.
The answer is 2 2 + 8 8 + 1 0 5 = 2 1 5 .
There are only 5 combinations by which the worker can build the path :
Number of ways of making the path for :
Case 1 = \frac {8!}{6! \times 2!} = 28
Case 2 = \frac {7!}{5! \times 2!} = 21
Case 3 = \frac {7!}{4! \times 2!} = 105
Case 4 = \frac {6!}{2! \times 3!} = 60
Case 5 = 1
Therefore , the total number of ways = 28 + 21 + 105 + 60 + 1 = \Box {215}
First, we find all integer solutions of: 6 x + 7 y + 1 0 z = 5 0 which are: ( x , y , z ) = ( 6 , 2 , 0 ) , ( 2 , 4 , 1 ) , ( 5 , 0 , 2 ) , ( 1 , 2 , 3 ) , ( 0 , 0 , 5 )
Then the total of ways is:
6 ! 2 ! 0 ! 8 ! + 2 ! 4 ! 1 ! 7 ! + 5 ! 0 ! 2 ! 7 ! + 1 ! 2 ! 3 ! 6 ! + 0 ! 0 ! 5 ! 5 ! = 2 8 + 1 0 5 + 2 1 + 6 0 + 1 = 2 1 5
For some reason it won't let me reply to Stanislaw's comment, but 0! = 1, not 0.
If you write " 6 ! 2 ! 0 ! 8 ! , it's equal to 0 8 ! , and you can't divide by zero...
Notice that the lengths of the boards are 6 0 cm, 7 0 cm and 1 0 0 cm.
And the length of the path is 5 0 0 cm.
A little work reveals to us that
5 0 0 = 1 0 0 + 1 0 0 + 1 0 0 + 1 0 0 + 1 0 0 = 6 0 + 6 0 + 6 0 + 6 0 + 6 0 + 7 0 + 7 0 = 6 0 + 6 0 + 6 0 + 6 0 + 6 0 + 1 0 0 + 1 0 0 = 6 0 + 6 0 + 7 0 + 7 0 + 7 0 + 7 0 + 1 0 0 = 6 0 + 7 0 + 7 0 + 1 0 0 + 1 0 0 + 1 0 0
These are the only cases where 5 0 0 can be written as the sum of 6 0 's, 7 0 's and 1 0 0 's.
We know that the number of orderings of n things where k of them are the same is given by the formula: k ! n !
Since the paths are different when planks are not used in the same order, we can say that the total number of paths is:
5 ! 5 ! + 6 ! 2 ! 8 ! + 5 ! 2 ! 7 ! + 2 ! 4 ! 7 ! + 2 ! 3 ! 6 !
Here we've simply taken the cases one by one and written how many orderings of the terms are possible. Now the only thing left is to do a little calculation.
The total number of different paths constructed is = 1 + 2 8 + 2 1 + 1 0 5 + 6 0
= 2 1 5 .
There are 5 possible forms of sum 500:
1 0 0 × ( 5 )
7 0 × ( 4 ) + 6 0 × ( 2 ) + 1 0 0 × ( 1 )
7 0 × ( 2 ) + 6 0 × ( 1 ) + 1 0 0 × ( 3 )
6 0 × ( 5 ) + 1 0 0 × ( 2 )
6 0 × ( 6 ) + 7 0 × ( 2 )
Using permutation with repeated elements, the number of paths is: 1 + ( 4 , 2 7 ) + ( 3 , 2 6 ) + ( 5 , 2 7 ) + ( 6 , 2 8 ) = 2 1 5
Let's do some casework to the solutions of the equation 6 0 x + 7 0 y + 1 0 0 z = 5 0 0 :
Case 1 : When x = 1 , y must be 2 , and z = 3 .
Case 2 : When x = 2 , y must be 4 , and z = 1
Case 3 When x = 3 , we see that the minimum value of y is 6 , but this exceeds 5 0 0
Case 4 : If x = 4 , then the minimum value of y must be 8 , but this also exceeds 5 0 0 .
Case 5 : If x = 5 , then y must be 0, and z = 2 .
Case 6 : If x = 6 , then y must be 2 and z = 0 .
For the last case, we let x and y be 0, so z = 5
There are no more cases, so we must now count the ways the planks can be arranged.
This is:
3 ! ∗ 2 ! 6 ! + 2 ! ∗ 4 ! ∗ 1 ! 7 ! + 5 ! ∗ 2 ! ∗ 0 ! 7 ! + 6 ! ∗ 2 ! ∗ 0 ! 8 ! + 5 ! 5 ! = 2 1 5
The length of the path is 500cm. Now, suppose we use the plank 60cm,a times ;70cm,b times and 100cm now prob is to find the number of solutions to the equation 60a+70b+100c=500 or 6a+7b+10c=50..........(1) now 6a always give even answer 10 b also give even quantity an 50 is even number so 7b must be even number=>b=0;2;4;6; case -1 if b=0 then eq (1) reduces to 3a+5c=25 we find two solutions (a,c)=(0,5)or (5,2). ordered triples are (a,b,c)=(0,0,5),(5,0,2) case-2 if b=2 then eq (1) reduces to 3a+5c=18 we find again two solutions (a,c)=(1,3)or (6,0). gives the triples (a,b,c)=(1,2,3),(6,2,0) case-3 if b=4 3a+5c=11. only the solution (a,c)=(2,1). So, another triplet is (a,b,c)=(2,4,1). case-4 if=6 then 3a+5b=4. There are no solutions in this case. So, all of the possible triples (a,b,c) are (0,0,5),(5,0,2),(1,2,3),(6,2,0),(2,4,1). now we count the number of ways to of arrangement of planks: (0,0,5)=>only 1 way (5,0,2)=> so there are 7!/5!2!=21 ways (1,2,3)=> 6!/3!2!=60 ways (6,2,0)=. 8/!6!2!=28 ways (2,4,1)=>7!/4!2!=105 ways. total there are 1+21+60+28+105=215 ways
Let no. of planks of length 60cm be a, no. of planks of length 70cm be b and no. of planks of length 100cm be c, Case-1 a=6, b=2, c=0, no. of ways =28, Case-2 a=2, b=4, c=1, no. of ways = 105, Case-3 a=5, b=0, c=2, no. of ways = 21, Case-4 a=1, b=2, c=3, no. of ways = 60, Case-5 a=0, b=0, c=5, no. of ways = 1. Hence, total no. of ways =28 +105 +21 +60 +1 = 215
Let x , y , z represent the no. of 6 0 c m , 7 0 c m , 1 0 0 c m planks respectively used to build the path. Then no. of each plank required will be a solution to the equation 6 0 x + 7 0 y + 1 0 0 z = 5 0 0 i.e. 6 x + 7 y + 1 0 z = 5 0 --- ( i )
where ( x , y , z ) ∈ Z + × Z + × Z +
We can obviously see that 0 ≤ z ≤ 5 --- ( i i )
If ( x 0 , y 0 , z 0 ) is a solution to -- ( i ) then total no. of ways associated with it is the total no. of permutations of ( x 0 , y 0 , z 0 ) which is nothing but ( x 0 ) ! ( y 0 ) ! ( z 0 ) ! ( x 0 + y 0 + z 0 ) ! .
We will take values of z one-by-one and find corresponding values of x and y . We will also use the fact that if 6 x + 7 y = 1 0 k for some 0 ≤ k ≤ 5 , then y has to be even since 6 x and 1 0 k are already even and difference of evens is an even.
Solution No. of ways
( 6 , 2 , 0 ) 2 8
( 2 , 4 , 1 ) 1 0 5
( 5 , 0 , 2 ) 2 1
( 1 , 2 , 3 ) 6 0
( 0 , 0 , 5 ) 1
Now adding up the numbers in the second column we get total no. of ways as 2 8 + 1 0 5 + 2 1 + 6 0 + 1 = 2 1 5 which is our answer.
A very silly typing error Z + should indeed be W i.e. the set of whole numbers.
Use casework to determine the possible combinations of lengths that you could make. Create an exhaustive list. I think I found like five different cases; from there you can use permutations to determine the different ways to arrange the boards.
The answer is 1 + 3 ! 2 ! 6 ! + 4 ! 2 ! 7 ! + 5 ! 2 ! 7 ! + 6 ! 2 ! 8 ! = 2 1 5 .
The only way to do this is to start with one of the lengths and see what is possible. You have to go 5 meters which is 500 cm, so
9 times 60 is 540. 9 60s is too many,
8 times 60 is 480. You don't have a 20 cm piece, so this doesn't work
7 times 60 is 420. No way to make 80 out of 70 and 100, so this doesn't work.
6 times 60 is 360. 500 minus 360 is 140 which you can make with two 70s.
5 times 60 is 300. 500 minus 300 is 200 which you can make with two 100s.
4 times 60 is 240. No way to get to 260 with just 70s and 100s, so this doesn't work.
3 times 60 is 180. Leaves 320, and you can't get there from here either without using 60s and that possibility is already counted above. 2 times 60 is 120. Leaves 380. 4 70s is 280 plus one 100 makes 380.
1 times 60 is 60. Leaves 440. 2 times 70 is 140 plus 3 times 100.
0 times 60. Leaves 500 which is just five 100s.
In sum:
5 100s 3 100s plus 2 70s plus 1 60 1 100 plus 4 70s plus 2 60s 2 100s plus 5 60s 2 70s plus 6 60s 5 ways. So now:- 1 + 6!/3!2! + 7!/4!2! + 7!/5!2! + 8!/6!2! = 215.
Use casework to determine the possible combinations of lengths that you could make. Create an exhaustive list. I think I found like five different cases; from there you can use permutations to determine the different ways to arrange the boards.
The answer is 1 + 6!/3!2! + 7!/4!2! + 7!/5!2! + 8!/6!2! = 215.
There are 5 cases to choose the set of planks:
Case 1 : 5 × 1 0 0 : this case only have 1 path.
Case 2 : 6 0 + 2 × 7 0 + 3 × 1 0 0 : there are 6 ! ways to build the path with 6 different planks, but 2 planks 70cm and 3 planks 100cm can be swapped to each other. Thus, the number of path can be built is 2 ! ⋅ 3 ! 6 ! = 6 0 .
Case 3 : 2 × 6 0 + 4 × 7 0 + 1 0 0 : the number of path can be built is 2 ! ⋅ 4 ! 7 ! = 1 0 5 .
Case 4 : 5 × 6 0 + 2 × 1 0 0 : the number of path can be built is 5 ! ⋅ 2 ! 7 ! = 2 1 .
Case 5 : 6 × 6 0 + 2 × 7 0 : the number of path can be built is 6 ! ⋅ 2 ! 8 ! = 2 8 .
So, the total number of path can be built is 1 + 6 0 + 1 0 5 + 2 1 + 2 8 = 2 1 5 .
1 + 6!/3!2! + 7!/4!2! + 7!/5!2! + 8!/6!2! = 215.
1 Multiple Of 60 that is less than 500 : 60, 120, 180, 240, 300, 360, 420, 480 2.Multiple Of 70 that is less than 500 : 70, 140, 210, 280, 350, 420, 490
3.Multiple Of 100 that is less than or equal to 500 : 100, 200, 300, 400, 500
In order to build a path that has lenght 500 cm, we can combine some numbers from above :
100+100+100+100+100 = 500 ( 5 places to be filled by 5 times of 100 ) So that : \frac {5!}{5!} = 1 way
60+60+60+60+60+60+70+70 = 500 ( 8 places to be filled by 6 times of 60 and 2 times of 70) So that:: \frac {8!}{6! 2!} = 28 ways
60+60+60+60+60+100+100 = 500 (7 places to be filled by 5 times of 60 and 2 times of 100) So that : \frac {7!} {5! 2!} = 21 ways
60+70+70+100+100+100 = 500 (6 places to be filled by 1 time of 60, 2 times of 70 and 3 times of 100) So that : \frac {6!} {1! 2! 3!} = 60 ways
60+60+70+70+70+70+100 = 500 (7 places to be filled by 2 times of 60, 4 times of 70 and 1 time of 100) So that : \frac {7!} {2! 4! 1!} = 105 ways
Summing those ways and we finally get = 215 ways
there are only 5 cases that is 5x100, 3x100+2x70+60, 2x100+5x60, 100+4x70+2x60, 2x70+6x60 case 1 (5x100) only 1 way case 2 (3x100+2x70+60) this is same with multinomial with 6!/(3!x2!x1!)=60 ways case 3 ( 2x100+5x60) 7!/(2!x0!x5!)=21ways case 4 (100+4x70+2x60) 7!/(1!x4!x2!)=105 ways and case 5 (2x70+6x60) 8!/(0!x2!x6!)=28 ways the total is 215
Using cases and combination, which we must find the combination of (x,y,z), which x,y,z is non-negative integers, from the equation 6 0 x + 7 0 y + 1 0 0 z = 5 0 0 , which is x,y,z represent the value of planks lengths, like 60 m, 70 m, and 100 cm. To make the cases become short, just start from the how many 100 cm planks we need. Just check from z = 0, 1, 2, 3, 4, 5
Case 1 : z = 0, so the equation become 6 0 x + 7 0 y = 5 0 0 6 x + 7 y = 5 0 we check the value from x = 0, we get x = 6, y = 2, so finally we found (x,y,z) = (6,2,0), which the combinations we get 6 ! 2 ! 8 ! = 2 8 pairs
Case 2 : z = 1, so the equation become 6 0 x + 7 0 y = 4 0 0 6 x + 7 y = 4 0 we check the value from x = 0, we get x = 2, y = 4, so finally we found (x,y,z) = (2,4,1), which the combinations we get 4 ! 2 ! 1 ! 7 ! = 1 0 5 pairs
Case 3 : z = 2, so the equation become 6 0 x + 7 0 y = 3 0 0 6 x + 7 y = 3 0 we check the value from x = 1, we get x = 5, y = 0, so finally we found (x,y,z) = (5,0,2), which the combinations we get 5 ! 2 ! 7 ! = 2 1 pairs
Case 4 : z = 3, so the equation become 6 0 x + 7 0 y = 2 0 0 6 x + 7 y = 2 0 we check the value from x = 1, we get x = 1, y = 2, so finally we found (x,y,z) = (1,2,3), which the combinations we get 3 ! 2 ! 1 ! 6 ! = 6 0 pairs
Case 5 : z = 4, so the equation become 6 0 x + 7 0 y = 1 0 0 6 x + 7 y = 1 0 we check the value from x = 1, but nothing we get from this cases
Case 6 : z = 5, the pairs we get is only 1, its (100,100,100,100,100)
Total combination overall
= 28 + 105 + 21 + 60 + 1
= 215
QED
Case I: No. of ways of arranging if there are 5, 100 cm plank + 0, 70 cm plank + 0, 60 cm plank = 5!/5! = 1
Case II: No. of ways of arranging if there are 5, 100 cm plank + 0, 70 cm plank + 0, 60 cm plank = 6!/3!2!1! = 60
Case III: No. of ways of arranging if there are 5, 100 cm plank + 0, 70 cm plank + 0, 60 cm plank = 7!/5!2! = 21
Case IV: No. of ways of arranging if there are 5, 100 cm plank + 0, 70 cm plank + 0, 60 cm plank = 7!/4!2!1! = 105
Case V: No. of ways of arranging if there are 5, 100 cm plank + 0, 70 cm plank + 0, 60 cm plank = 8!/6!2! = =28
Total number of ways = 1 + 60 + 21 + 105 + 28 = 215
Since the numbers are all divisible by 1 0 we can ask the same question using the numbers 7 , 6 , 1 0 a n d 5 0 instead.
Now since 7 is odd and 6 , 1 0 , 5 0 are all even, we can therefore deduce that we can either have four, two or no 7 ′ s in our path. If we had four we would then need to make 5 0 − 2 8 = 2 2 out of 6 ′ s and 1 0 ′ s . Since the multiples of 6 that end in a 2 are 1 2 , 4 2 , 7 2 and so on, we can only use two 6 ′ s or else we would have a longer than 5 0 c m path. With the two 6 ′ s we now have 5 0 − 2 8 − 1 2 = 1 0 left so we simply use one 1 0 . Since there are four 7 ′ s , two 6 ′ s and one 1 0 , there are therefore 4 ! ∗ 2 ! 7 ! = 1 0 5 permutations.
Now if we had only two 7 ′ s for a total of 1 4 we then need to make 5 0 − 1 4 = 3 6 out of 6 ′ s and 1 0 ′ s . There are two ways to do this, one is to use one 6 and three 1 0 ′ s , the other is to use six 6 ′ s . In the first case there are 2 ! ∗ 3 ! 6 ! = 6 0 permutations. In the second case there are 6 ! ∗ 2 ! 8 ! = 2 8 permutations.
Finally, if we were to use no 7 ′ s at all, we would then need to make 5 0 out of only 6 ′ s and 1 0 ′ s . Again there are two ways to do this. One is to use five 6 ′ s and two 1 0 ′ s , the other is to use no 6 ′ s and five 1 0 ′ s . In the first case there are 5 ! ∗ 2 ! 7 ! = 2 1 permutations. In the second case there are 5 ! 5 ! = 1 permutation.
Putting it all together we get that there are a total of 1 0 5 + 6 0 + 2 8 + 2 1 + 1 = 2 1 5 paths that can be made.
Let a , b , c be the number of 60, 70, and 100 cm planks used. The number of different paths is the sum of a ! b ! c ! ( a + b + c ) ! over all a , b , c satisfying 6 a + 7 b + 1 0 c = 5 0 . Note that a ≤ 8 b ≤ 7 c ≤ 5 it would be quickest to consider cases on c . Suppose c = 5 . Then 6 a + 7 b = 0 with a = b = 0 being the only possibility, yielding 1 ordering.
Suppose c = 4 . 6 a + 7 b = 1 0 has no solution so there are no orderings.
Suppose c = 3 . 6 a + 7 b = 2 0 has exactly one solution: ( a , b ) = ( 1 , 2 ) . This yields 3 ! 2 ! 6 ! = 6 0 orderings.
Suppose c = 2 . 6 a + 7 b = 3 0 has exactly one solution: ( a , b ) = ( 5 , 0 ) . This yields 5 ! 2 ! 7 ! = 2 1 orderings.
Suppose c = 1 . 6 a + 7 b = 4 0 has exactly one solution: ( a , b ) = ( 2 , 4 ) . This yields 2 ! 4 ! 7 ! = 1 0 5 orderings.
Suppose c = 0 . 6 a + 7 b = 5 0 has exactly one solution: ( a , b ) = ( 6 , 2 ). This yields 6 ! 2 ! 8 ! = 2 8 orderings.
Finally, the sum of all orderings is 1 + 6 0 + 2 1 + 1 0 5 + 2 8 = 2 1 5 .
There are 5 possibilities of combining the planks lengths: 5 × 1 m , 3 × 1 m + 6 0 c m + 2 × 7 0 c m , 2 × 1 m + 5 × 6 0 c m , 1 m + 2 × 6 0 c m + 4 × 7 0 c m and 6 × 6 0 c m + 2 × 7 0 c m . In each of the combinations we divide number of all planks ! by number of planks 1m ! We divide the sum by number of planks 70cm !, and then by number of planks 60cm !. If any number of planks is equal to zero, we do not divide, because the sum must always be at least 1. Example: 6 × 6 0 c m + 2 × 7 0 c m . (8!/6!)/2!. There are no 1m planks, but we don't divide by 0!. The sums are: 1, 60, 21, 105, 28. The sum of these all is 215, so that is the answer. )
I first find all triples of nonnegative integers ( a , b , c ) such that 1 0 a + 6 b + 7 c = 5 0 . Note that always,
⎩ ⎪ ⎨ ⎪ ⎧ 0 ≤ a ≤ 5 , 0 ≤ b ≤ 8 , 0 ≤ c ≤ 7 .
Due to parity, c is always even. I consider 4 cases.
Case 1 : c = 0
This implies that 1 0 a + 6 b = 5 0 ⟹ 5 a + 3 b = 2 5 ⟹ 3 b ≡ 0 ( m o d 5 ) ⟹ b ∈ { 0 , 5 } . So, this case yields two triples: ( 5 , 0 , 0 ) and ( 2 , 5 , 0 ) .
Case 2 : c = 2
This implies that 1 0 a + 6 b = 3 6 ⟹ 5 a + 3 b = 1 8 ⟹ 5 a ≡ 0 ( m o d 3 ) ⟹ a ∈ { 0 , 3 } . So, this case also yields two triples: ( 0 , 6 , 2 ) and ( 3 , 1 , 2 ) .
Case 3 : c = 4
This implies that 1 0 a + 6 b = 2 2 ⟹ 5 a + 3 b = 1 1 . Obviously, the only triple that this case yields is ( 1 , 2 , 4 ) .
Case 4 : c = 6
This implies that 1 0 a + 6 b = 8 , and there are obviously no nonnegative integers a , b that satisfy this.
So, ( a , b , c ) ∈ { ( 5 , 0 , 0 ) , ( 2 , 5 , 0 ) , ( 0 , 6 , 2 ) , ( 3 , 1 , 2 ) , ( 1 , 2 , 4 ) } . For such a triple ( a , b , c ) , the number of possible permutations is a ! ⋅ b ! ⋅ c ! ( a + b + c ) ! because the planks can be ordered in ( a + b + c ) ! ways, but then all 1 meter planks have been permuted as well while they are the same, so we need to divide by a ! , and for similar reasons, we need to divide by b ! and by c ! . Thus, the total number of different paths that could be constructed is
5 ! 5 ! + 2 ! ⋅ 5 ! ( 2 + 5 ) ! + 6 ! ⋅ 2 ! ( 6 + 2 ) ! + 3 ! ⋅ 1 ! ⋅ 2 ! ( 3 + 1 + 2 ) ! + 1 ! ⋅ 2 ! ⋅ 4 ! ( 1 + 2 + 4 ) ! 1 + 2 1 + 2 8 + 6 0 + 1 0 5 = = 2 1 5 .
Hey Tim I and probably everyone can see 3 comments but they are spookily missing. Is anything wrong or they have been deleted ? And don't you think the voting system is a bit unfair(may be even worse at times) because people who submit a little late(maybe they solved late or took time in LaTeXing it properly ?
Yeah they're deleted, I've never seen them, maybe it was spam.
I agree that the voting system as it is is a bit unfair, because they didn't randomize the solutions. I'm pretty sure next week it will be fixed.
case 1: 0 planks of 1m. we need 6 planks of 60 cm and 2 planks of 70 cm to complete the path.. 8!/(6!2!)=28 ways
case 2: 1 plank of 1m. we need 4 of 70cm and 2 of 60 cm.. 105 ways.
case 3: 2 plank of 1m. we need 5 of 60cm. 21 ways
case 4: 3 planks of 1m. we need 2 of 70cm and 1 of 60cm .. 60 ways
case 5: 4 plank of 1m. not possible
case 6: 5 plank of 1 m. 1 way
adding all the 6 cases we get 215 ways..
Solving the equation of 6a+7b+10c=50, we get 5 different sets of solutions:
a=1, b=2, c=3
a=2, b=4, c=1
a=5, b=0, c=2
a=6, b=2, c=0
a=0, b=0, c=5
the 5 ways of arranging the planks can construct a total number of
1 ! 2 ! 3 ! 6 ! + 2 ! 4 ! 1 ! 7 ! + 5 ! 2 ! 7 ! + 6 ! 2 ! 8 ! + 1 = 2 1 5
distinct permutations.
Hence the answer is 2 1 5 .
Problem Loading...
Note Loading...
Set Loading...
The length of the path is 5 0 0 c m . Now, suppose we use the plank 6 0 c m , a times ; 7 0 c m , b times and 1 0 0 c m , c times where a , b , c are non-negative integers,
Then, 5 0 0 = 6 0 a + 7 0 b + 1 0 0 c
⇒ 5 0 − 1 0 c − 6 a = 7 b
⇒ 7 5 0 − 1 0 c − 6 a = b where 0 ≤ c ≤ 5
Now, putting all values of c we get only 5 integer solution of ( a , b , c ) and those are :
1 : ( 6 , 2 , 0 ) and wee can arrange it in 6 ! × 2 ! ( 6 + 2 ) ! = 6 ! × 2 ! 8 ! = 2 8 ways.
2 : ( 2 , 4 , 1 ) we can arrange this in 4 ! × 2 ! ( 2 + 4 + 1 ) ! = 4 ! × 2 ! 7 ! = 1 0 5 ways.
3 : ( 5 , 0 , 2 ) we can arrange this in 5 ! × 2 ! ( 5 + 0 + 2 ) ! = 5 ! × 2 ! 7 ! = 2 1 ways.
4 : ( 1 , 2 , 3 ) we can arrange it in 3 ! × 2 ! ( 1 + 2 + 3 ) ! = 3 ! × 2 ! 6 ! = 6 0 ways.
5 : ( 0 , 0 , 5 ) we can arrange this in 5 ! 5 ! = 1 ways.
Now, total we can create ( 2 8 + 1 0 5 + 2 1 + 6 0 + 1 ) = 2 1 5 different path.