Dear Genius,

Good day!

The number of apples in a basket is between 60 and 120. If i put these apples into bags of 5, there will be a remainder of 1 apple. If i put these apples into bags of 8, there will be a remainder of 6 apples. Find the total number of apples in the basket.

I managed to find out the answer using Guess and check method. Please kindly give the solution in other easier methods.

Thank you.
Surya

The other methods are not easier, but can solve more problems. The other method makes use of the "Chinese remainder theorem" (CRT). If you have done modulo arithmetic, you can solve using the CRT. Otherwise you can proceed as follows (also guess & check).

If there is 1 left using bags of 5, the last digit must be 1 or 6.

In bags of 8, there are 6 left, so start with 54 (8*6+6=54) and add 8 until the last digit is 6 (cannot be 1).

Adding 32 will give 54+32=86 is therefore the answer. The next good answer will be 86+40=122>120.

86+40=126(>120)

Dear Surya,

To find the total number of apples in the basket, we can solve the problem using algebraic equations. Let's denote the number of apples as x.

According to the given information, when we divide x by 5, there is a remainder of 1 apple. This can be written as:

x ≡ 1 (mod 5)

Similarly, when we divide x by 8, there is a remainder of 6 apples. This can be written as:

x ≡ 6 (mod 8)

To solve these congruence equations, we can use the Chinese Remainder Theorem (CRT). Here's how to do it step by step:

Step 1: Calculate the least common multiple (LCM) of the moduli, 5 and 8. The LCM of 5 and 8 is 40.

Step 2: Assign variables to the remainders in each congruence equation. Let r1 = 1 and r2 = 6.

Step 3: Solve the congruence equations for each modulus individually to find the unknowns. Since the LCM is 40, we have:

5a ≡ 1 (mod 40) ⇒ a ≡ 9 (mod 40)
8b ≡ 6 (mod 40) ⇒ b ≡ 23 (mod 40)

Step 4: Combine the solutions from step 3 using CRT. The solution is given by:

x ≡ (r1 * M1 * a) + (r2 * M2 * b) ≡ (1 * 5 * 9) + (6 * 8 * 23) ≡ 45 + 1104 ≡ 1149 (mod 40)

Step 5: Find the smallest positive solution that satisfies the congruence equation. Adding 40 to the solution repeatedly until we get a positive value less than 120, we find that the smallest positive solution is:

x ≡ 1149 + 40k

By checking different values of k, we find that x = 109 is the only value between 60 and 120 that satisfies both congruence equations.

Therefore, the total number of apples in the basket is 109.

Using this method, we can easily solve the problem without relying on guess and check.

I hope this explanation helps. If you have any further questions, please let me know.

Sincerely,
Explain Bot