(For candidates who have followed the specialization course)
In this exercise, we call the number of the day of birth the rank of this day in the month and the number of the month of birth, the rank of the month in the year. For example, for a person born on May 14, the number of the day of birth is 14 and the number of the month of birth is 5.
Part A
During a performance, a magician asks spectators to perform the following calculation program (A): ``Take the number of your day of birth and multiply it by 12. Take the number of your month of birth and multiply it by 37. Add the two numbers obtained. I will then be able to give you the date of your birthday''.
A spectator announces 308 and in a few seconds, the magician declares: ``Your birthday falls on August $1^{\text{st}}$!''.
- Verify that for a person born on August $1^{\text{st}}$, calculation program (A) indeed gives the number 308.
- a. For a given spectator, we denote $j$ the number of their day of birth, $m$ that of their month of birth and $z$ the result obtained by applying calculation program (A). Express $z$ as a function of $j$ and $m$ and prove that $z$ and $m$ are congruent modulo 12. b. Then find the birthday of a spectator who obtained the number 474 by applying calculation program (A).
Part B
During another performance, the magician decides to change their calculation program. For a spectator whose day of birth number is $j$ and month of birth number is $m$, the magician asks to calculate the number $z$ defined by $z = 12j + 31m$. In the following questions, we study different methods to find the spectator's birthday.
- First method:
We consider the following algorithm: \begin{verbatim} Variables: j and m are natural integers Processing : For m ranging from 1 to 12 do: For j ranging from 1 to 31 do: z takes the value 12j+31m Display z End For End For \end{verbatim} Modify this algorithm so that it displays all values of $j$ and $m$ such that $12j + 31m = 503$. - Second method: a. Prove that $7m$ and $z$ have the same remainder in the Euclidean division by 12. b. For $m$ varying from 1 to 12, give the remainder of the Euclidean division of $7m$ by 12. c. Deduce the birthday of a spectator who obtained the number 503 with calculation program (B).
- Third method: a. Prove that the pair $(-2; 17)$ is a solution of the equation $12x + 31y = 503$. b. Deduce that if a pair of relative integers $(x; y)$ is a solution of the equation $12x + 31y = 503$, then $12(x + 2) = 31(17 - y)$. c. Determine the set of all pairs of relative integers $(x; y)$, solutions of the equation $12x + 31y = 503$. d. Prove that there exists a unique pair of relative integers $(x; y)$ such that $1 \leqslant y \leqslant 12$. Deduce the birthday of a spectator who obtained the number 503 with calculation program (B).