David W. answered 06/04/15
Tutor
4.7
(90)
Experienced Prof
Well, if you are really annoyed enough, then this is a “teachable moment” (teachers/tutors live for such a time).
Remember learning about positional number systems. For example, decimal numbers have value depending on their place (right to left) in the number. That is, there is 1’s place and 10’s place and 100’s place. That way you can tell, for say for 325, that there are 5*1 + 2*10 + 3*100 total.
Now, instead of positions, you have bags and the total is computed by multiplying (up to a “large number”) by 1, 3, 5, or 7 and the total must be 37. So how many different combinations of 10 or fewer digits is this?
Systematically, we could start by using as many 7’s as possible with a total of 37 or less, then add 5’s, then 3’s then 1’s until we get 37 (or we could start with 1’s, then 3’s, 5’s an 7’s) using 10 digits (and using a 0 is critically important in a positional number system). When we use all possible of a specific digit, then we increment the next digit (much like an odometer, a gas pump, or other counter increments).
However, as mathematicians, we can let A,B,C,D be the how many of that number we picked from each of four bags and write:
A*7 + B*5 + C*3 + D*5 = 37
A + B + C + D = 10
And observe that:
If A = 0, then B + C + D must = 10
If A=1, then B + C + D must = 9
If A = 2, then B + C + D must = 8
… and so on …
Also, When A=0, if B = 0, then C + D must = 10 … also, and so on.
Finally, When A = 0 and B = 0 and C = 0, then there is no D that is 10 or less which makes 37.
So, the “exhaustive iteration” (count like an odometer and try the total) method looks like this:
Start answer counter at 0
For A goes from 0 to 5 then (it cannot be larger than 5)
For B goes from 0 to 7 then (7*5’s = 35)
For C goes from 0 to 10 (12*3 is 36, but we only have 10 choices)
For D goes from 0 to 10 (again, only 10 choices)
If (A+B+C+D = 10) and ( (A*7 + B*5 + C*3 + D*1) = 37 ) then
This is an answer; increment answer counter
NEXT
NEXT
NEXT
NEXT
How do like a computer program ??
Remember learning about positional number systems. For example, decimal numbers have value depending on their place (right to left) in the number. That is, there is 1’s place and 10’s place and 100’s place. That way you can tell, for say for 325, that there are 5*1 + 2*10 + 3*100 total.
Now, instead of positions, you have bags and the total is computed by multiplying (up to a “large number”) by 1, 3, 5, or 7 and the total must be 37. So how many different combinations of 10 or fewer digits is this?
Systematically, we could start by using as many 7’s as possible with a total of 37 or less, then add 5’s, then 3’s then 1’s until we get 37 (or we could start with 1’s, then 3’s, 5’s an 7’s) using 10 digits (and using a 0 is critically important in a positional number system). When we use all possible of a specific digit, then we increment the next digit (much like an odometer, a gas pump, or other counter increments).
However, as mathematicians, we can let A,B,C,D be the how many of that number we picked from each of four bags and write:
A*7 + B*5 + C*3 + D*5 = 37
A + B + C + D = 10
And observe that:
If A = 0, then B + C + D must = 10
If A=1, then B + C + D must = 9
If A = 2, then B + C + D must = 8
… and so on …
Also, When A=0, if B = 0, then C + D must = 10 … also, and so on.
Finally, When A = 0 and B = 0 and C = 0, then there is no D that is 10 or less which makes 37.
So, the “exhaustive iteration” (count like an odometer and try the total) method looks like this:
Start answer counter at 0
For A goes from 0 to 5 then (it cannot be larger than 5)
For B goes from 0 to 7 then (7*5’s = 35)
For C goes from 0 to 10 (12*3 is 36, but we only have 10 choices)
For D goes from 0 to 10 (again, only 10 choices)
If (A+B+C+D = 10) and ( (A*7 + B*5 + C*3 + D*1) = 37 ) then
This is an answer; increment answer counter
NEXT
NEXT
NEXT
NEXT
How do like a computer program ??
It took 4 minutes to write and the time to run it was so fast that I couldn’t measure it. The answer counter was 0!
What does that mean ???
Yikes! It means that 10 numbers (using 1,3,5,and 7 as many times as you want) will not add up to 37.