Candy Riddle

Amy and Nick, the twin siblings, are planning to hold a party in their house, so they independently call to their elementary class mates to bring the snack over.

Nick's friends, a group of 7 7 boys, have brought a big bag of candies. If they are divided equally among these 7 7 boys, there will be 4 4 candies remaining.

On the other hand, Amy's friends, a group of 8 8 girls, have also brought another big bag of candies. If they are divided equally among these 8 8 girls, there will be 5 5 candies remaining.

When both groups arrive at the house, they combine all the candies from both bags into one big bowl, which Amy and Nick have arranged. If all the candies are divided equally among all these 17 17 children, there will be only 2 2 candies remaining. Moreover, the total candies they have are of the least possible amount satisfying all these constraints.

Initially, what is the difference of the candies in both bags?


The answer is 11.

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.

1 solution

Let x x be the amount of candies in the boys' bag and y y be that in the girls' bag. We can set up the modular equivalences, as followed:

x 4 ( m o d 7 ) x \equiv 4 \pmod{7} y 5 ( m o d 8 ) y \equiv 5 \pmod{8} x + y 2 ( m o d 17 ) x+y \equiv 2 \pmod{17}

Alternatively, we can rewrite x = 7 p + 4 x = 7p + 4 and y = 8 q + 5 y = 8q +5 for some non-negative integers p , q p,q . Then there are three scenarios for these quotients p , q p,q .

First of all, if p = q p=q , the modular equivalence will be, as followed:

x + y 15 p + 4 + 5 2 ( m o d 17 ) x+y \equiv 15p + 4+5 \equiv 2 \pmod{17} 7 2 p ( m o d 17 ) 7 \equiv 2p \pmod{17}

Since 2 × 9 1 ( m o d 17 ) 2\times 9 \equiv 1 \pmod{17} , the modular inverse of 2 2 is 9 9 per modulo 17 17 .

9 × 2 p p 9 × 7 63 12 ( m o d 17 ) 9\times 2p \equiv p \equiv 9\times 7 \equiv 63 \equiv 12 \pmod{17}

Because p p is non-negative, the minimal value of p = q p=q is 12 12 . This results in x = 7 × 12 + 4 = 88 x=7\times 12 + 4 =88 and y = 8 × 12 + 5 = 101 y=8\times 12 + 5 =101 . The total is 88 + 101 = 189 88+101 = 189 .

Now we will examine the other scenarios.

Second, if p > q p>q , then we can set up p = q + n p = q + n for some positive integer n n , and the modular equivalence will be, as followed:

x + y 15 q + 7 n + 9 2 ( m o d 17 ) x+y \equiv 15q + 7n + 9 \equiv 2 \pmod{17} 7 n + 7 2 q ( m o d 17 ) 7n+7 \equiv 2q \pmod{17} 2 q 7 ( n + 1 ) ( m o d 17 ) 2q \equiv 7(n+1) \pmod{17} 9 × 2 q q 63 ( n + 1 ) 5 ( n + 1 ) ( m o d 17 ) 9\times 2q \equiv q \equiv 63(n+1) \equiv -5(n+1) \pmod{17} q + 5 ( n + 1 ) 0 ( m o d 17 ) q+5(n+1) \equiv 0 \pmod{17}

In order to yield the least possible values of x , y x,y , the resulting number must be 17 17 , the least positive multiple. That is 5 ( n + 1 ) + q = 17 5(n+1) + q = 17 .

Clearly, the number 5 5 acts as a divisor with n + 1 n+1 as the quotient and q q as the remainder. Therefore, n + 1 = 3 n+1 = 3 ; n = 2 n=2 ; q = 2 q=2 . That will lead to p = q + n = 4 p = q+n = 4 . Then x = 7 × 4 + 4 = 32 x=7\times 4 + 4 =32 and y = 8 × 2 + 5 = 21 y =8\times 2 + 5 =21 . The total is 32 + 21 = 53 32+21 = 53 .

Definitely, the first scenario fails to be the least values, and so we move on to the last scenario.

If q > p q>p , then we can set up q = p + m q = p + m for some positive integer m m , and the modular equivalence will be, as followed:

x + y 15 p + 8 m + 9 2 ( m o d 17 ) x+y \equiv 15p + 8m + 9 \equiv 2 \pmod{17} 7 2 p 8 m ( m o d 17 ) 7 \equiv 2p-8m \pmod{17} 7 2 ( p 4 m ) ( m o d 17 ) 7 \equiv 2(p-4m) \pmod{17} 9 × 7 12 p 4 m ( m o d 17 ) 9\times 7 \equiv 12 \equiv p-4m \pmod{17} 4 ( m + 3 ) p 0 ( m o d 17 ) 4(m+3) - p \equiv 0 \pmod{17}

Similarly, as previously explained, 4 ( m + 3 ) p = 17 4(m+3) - p = 17 although this time, the remainder is of negative value, so we just need to find the least multiple of 4 4 that exceeds 17 17 . That is obviously 20 20 . Then it is not brutal to calculate that 4 × 5 3 = 17 4\times 5 - 3 = 17 . Thus, m + 3 = 5 m+3 = 5 ; m = 2 m=2 ; and p = 3 p = 3 . That lead to q = 3 + 2 = 5 q = 3+2 =5 . Then x = 7 × 3 + 4 = 25 x=7\times 3 + 4 =25 and y = 8 × 5 + 5 = 45 y =8\times 5 + 5 =45 . The total is 25 + 45 = 70 25+45 = 70 .

Again, the last scenario also fails to satisfy, making the second scenario the desired solution. Finally, the difference between the candies in both bags equals 32 21 = 11 32-21 = \boxed{11} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...