Question

In: Computer Science

1. Use the Extended Euclid's Algorithm to solve ƒ-1 for 8 mod 11 2. Use the...

1. Use the Extended Euclid's Algorithm to solve ƒ-1 for 8 mod 11

2. Use the max function to calculate max3(x, y, z) if x = 2, y = 6, z = 5. Show your work!

Solutions

Expert Solution

1. First lets apply the algorithm. It will verify that gcd(8,11) = 1.

11 = 8(1) + 3

8 = 3(2) + 2

3 = 2(1) + 1

2 = 1(2)

Now solve for remainders,

3 = 11 - 8(1)

2 = 8 - 3(2)

1 = 3 - 2(1)

Now reverse the process using these equations,

1 = 3 - 2(1)

1 = 3 - (8 - 3(2)) (1)

1 = 3 - (8 - (3(2))

1 = 3(3) - 8

1 = (11 - 8(1) )(3) - 8

1 = 11(3) - 8(4)

1 = 11(3) + 8(-4)

Therefore 1 ≡ 8(−4) mod 11, or if you want to prefer a residue value for f-1,

1 ≡ 8(7) mod 11.

2. As the programming language is not mentioned so I am doing it in C++. Let's define a max3(x,y,z) function which will calculate the maximum of 3 values.

int max3(int x, int y, int z)

{

int largest = x;

if(largest < y)

largest = y;

if(largest < z)

largest = z;

else

return largest.

}

This function will find the largest of three numbers.

If you want to use the by-default function max(), you can prefer Python language as it simply provides a by-default function to calculate the largest of the given numbers.

If you still have any doubt/query regarding the solution then let me know in comment. If it helps, kindly give an upVote to this answer.


Related Solutions

Use the Extended Euclid's Algorithm to solve ƒ-1  for 8 mod 11
Use the Extended Euclid's Algorithm to solve ƒ-1  for 8 mod 11
1. Use backward substitution to solve: x=8 (mod 11) x=3 (mod 19)
  1. Use backward substitution to solve: x=8 (mod 11) x=3 (mod 19) 2. Fine the subgroup of Z24 (the operation is addition) generates by the element 20. 3. Find the order of the element 5 in (z/7z)
use algorithm modular exponentiation to find 11^644 mod 645
use algorithm modular exponentiation to find 11^644 mod 645
a) Use Fermat’s little theorem to compute 52003 mod 7, 52003 mod 11, and 52003 mod 13.
  a) Use Fermat’s little theorem to compute 52003 mod 7,52003 mod 11, and 52003 mod 13. b) Use your results from part (a) and the Chinese remaindertheorem to find 52003 mod 1001. (Note that1001 = 7 ⋅ 11 ⋅ 13.)
Compute the following: (a) 13^2018 (mod 12) (b) 8^11111 (mod 9) (c) 7^256 (mod 11) (d)...
Compute the following: (a) 13^2018 (mod 12) (b) 8^11111 (mod 9) (c) 7^256 (mod 11) (d) 3^160 (mod 23)
Solve a system of equations: 1- 2x = 5 mod 15   3x = 1 mod 4...
Solve a system of equations: 1- 2x = 5 mod 15   3x = 1 mod 4 2- x = 5 mod 15 x = 2 mod 12 (Hint: Note that 15 and 12 are not relatively prime. Use the Chinese remainder theorem to split the last equation into equations modulo 4 and modulo 3)
Solve the following system of congruences: x ≡ 2 (mod 14) x ≡ 16 (mod 21)...
Solve the following system of congruences: x ≡ 2 (mod 14) x ≡ 16 (mod 21) x ≡ 10 (mod 30)
We also discussed the use of the Extended Euclidian algorithm to calculate modular inverses. Use this...
We also discussed the use of the Extended Euclidian algorithm to calculate modular inverses. Use this algorithm to compute the following values. Show all of the steps involved. 9570-1(mod 12935) 550-1 (mod 1769)
a. Using the Euclidean Algorithm and Extended Euclidean Algorithm, show that gcd(99; 5) = 1 and...
a. Using the Euclidean Algorithm and Extended Euclidean Algorithm, show that gcd(99; 5) = 1 and find integers s1 and t1 such that 5s1 + 99t1 = 1. [Hint: You should find that 5(20) + 99(?1) = 1] b. Solve the congruence 5x 17 (mod 99) c. Using the Chinese Remainder Theorem, solve the congruence x 3 (mod 5) x 42 (mod 99) d. Using the Chinese Remainder Theorem, solve the congruence x 3 (mod 5) x 6 (mod 9)...
Problem 2. Use the FFT algorithm to evaluate f(x) = 8 − 4x + 2x 2...
Problem 2. Use the FFT algorithm to evaluate f(x) = 8 − 4x + 2x 2 + 3x 3 − 5x 4 − 4x 5 + 2x 6 + x 7 at the eight 8th roots of unity mod 17. You may stop using recursion when evaluating a linear function (a + bx), which is easier to do directly. The eight 8th roots of unity mod 17 are 1, 2, 4, 8, 16, 15, 13, 9; it is easier to...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT