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 Recursive Algorithm to compute 5^23 Mod 8
Use Recursive Algorithm to compute 5^23 Mod 8
use algorithm modular exponentiation to find 11^644 mod 645
use algorithm modular exponentiation to find 11^644 mod 645
Use the Pohlig-Hellman algorithm to solve 19x ≡ 184 (mod 337) for x. Write out at...
Use the Pohlig-Hellman algorithm to solve 19x ≡ 184 (mod 337) for x. Write out at least one successive squaring in detail, and at least one instance of the Chinese Remainder Theorem.
11. Use Euclid’s extended algorithm to find x and y for Gcd(241, 191) = 241 x...
11. Use Euclid’s extended algorithm to find x and y for Gcd(241, 191) = 241 x + 191 y Show all work.
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)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT