Question: Please use basic MATLAB functions and processes to implement the code for the following problems. Please read instructions carefully and include well detailed comments so
Please use basic MATLAB functions and processes to implement the code for the following problems. Please read instructions carefully and include well detailed comments so that I can follow each step. Thank you in advance.

3. Chinese Remainder Theorem (25 points) The Chinese Remainder Theorem deals with modulo (think remainder) arithmetic. For ex- ample, suppose we have the list of numbers 13,4,5). These numbers are pairwise coprime Now suppose we want to find a number X such that the following holds true: The remainder of is 2. The remainder of is 3. e The remainder of is 1. We can calculate X, which is the purpose of the Chinese remainder theorem, by using the congruence classes function defined in Problem 2 with the cutoff set to 3 4 5 60. In this case, we have the following: congruence (2,3,60) 12, 5, 8, 11, 14, 17, 20, 23,26,29, 32,35, 38, 41, 44,47, 50, 53, 56,59) congruence (3,4,60) 13,7, 11, 15, 19, 23,27, 31,35, 39, 43,47,51,55, 59) congruence(i 5,60) (1.6.11.16.21, 26, 31, 36, 41, 46, 51, 56) The X that solves this problem is 11, which happens to be the smallest intersection of the three sets. Note that 11 mod 3 is 2, 11 mod 4 is 3, and 11 mod 5 is 1. For this problem, you need to calculate X where the function parameters are the list of moduli and the list of remainders. In the above example, the function can be called in MATLAB as crt(13 4 5, 12 3 ij), which will return 11 given the example above. If the list of numbers passed are not pairwise coprime, return -1 (or some other sentinel value to indicate that the Chinese remainder theorem is not applicable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
