Horrendous Horror.

You happen to visit a school. You meet the maths teacher of the school and ask her for the total number of enrollments in the past 20 25 20-25 years. The maths teacher doesn't know what exactly it is but quite evasively leaves you with a puzzle that she's sure that you can never solve. The puzzle is as follows: To have an equal number of students in a classroom, they tried grouping them in a size of 71 , 73 , 75 , 77 71,73,75,77 students. To their irritation, they found that 12 , 26 , 34 , 59 12,26,34,59 students are left in each case. She then asks you to find the least number of enrollments with which such a scenario is possible. Will you outsmart her??

Note -Enter you answer according to the question.


The answer is 19140334.

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.

2 solutions

You want to solve this:

x 12 ( m o d 71 ) x \equiv 12 \pmod {71} x 26 ( m o d 73 ) x \equiv 26 \pmod {73} x 34 ( m o d 75 ) x \equiv 34 \pmod {75} x 59 ( m o d 77 ) x \equiv 59 \pmod {77}

Compute M = 71 × 73 × 75 × 77 M = 71 \times 73 \times 75 \times 77

Compute M i = M m i M_i = \frac{M}{m_i} for each modulus m i m_i

You'll get ( M 1 , M 2 , M 3 , M 4 ) = ( 421575 , 410025 , 39901 , 388725 ) (M_1,M_2,M_3,M_4)= (421575, 410025, 39901, 388725)

Compute x i M i 1 ( m o d m i ) x_i \equiv M_i^{-1} \pmod{m_i} for each m i m_i using Extended Euclidean Algorithm .

You'll get ( x 1 , x 2 , x 3 , x 4 ) = ( 37 , 41 , 61 , 8 ) (x_1,x_2, x_3,x_4) = (37, 41, 61, 8)

We are ready! Thank the stars!

Compute x i = 1 4 m i M i x i ( m o d M ) x \equiv \sum_{i=1}^{4} m_i M_i x_i \pmod {M}

You'll get x 19140334 ( m o d 29931825 ) \boxed{x \equiv 19140334 \pmod {29931825}}

which is obviously the smallest possible solution.


Why care, anyway?

Go to Wolfram|Alpha and run this code:

ChineseRemainder[{12, 26, 34, 59}, {71, 73, 75, 77}]

The final note asks us to enter the answer according to the question.The question was "will you outsmart her?". The answer then should be "of course".

Rahul Saha - 6 years, 8 months ago

Log in to reply

LOL....Did you outsmart her? :P

Krishna Ar - 6 years, 8 months ago
Manikanta Hr
Oct 5, 2014

I did this by a code. Run this code and you will get the number.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <iostream>


using namespace std;


int main()

{

    long int x=71,y;

    agn: if(((x-12)%71)==0)

    {

        if((x-26)%73==0)

            {

                if((x-34)%75==0)

                {

                    if((x-59)%77==0)

                    {

                     std::cout<< x<<std::endl;

                    goto ter;

                    }

                }

            }

    }


    x++;

    goto agn;

ter: cin>> y;

return x;

} 

The objective of this problem is not to find out how good a person is at coding.

Krishna Ar - 6 years, 8 months ago

Log in to reply

This is a classical CRT problem

Agnishom Chattopadhyay - 6 years, 8 months ago

I agree, but we will be having 4 equations with 5 unknowns if we try to solve it the traditional way. So I went for the code. I will see if I can come up with any other ways to figure it out.

Manikanta Hr - 6 years, 8 months ago

Log in to reply

No. You are partially incorrect. There's something called Number theory-Modular Arithmetic to simplify this.

Krishna Ar - 6 years, 8 months ago

improve the code!

Agnishom Chattopadhyay - 6 years, 8 months ago

If it is so, I can program a two-liner in python which would be the best possible solution, but I didn't. ITs nice that you solved using code, but it doesnt serve the purpose of a solution.

Krishna Ar - 6 years, 8 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...