1. Using Euclid’s formula to find the GCD of 342 and -7542. Please show work Euc
ID: 3824133 • Letter: 1
Question
1.
Using Euclid’s formula to find the GCD of 342 and -7542. Please show work
Euclid’s formula: gcd(a,b) = gcd(b, a mod b)
2. What is the value of c in the following equation:
c = -37 mod 23
9
11
6
None of the above
3. c = -41 mod 4
4. Compute the following modular exponentiation equation
719 mod 100
5. Which of the following best describes what the following Bare Bones program does?
copy X to Z
clear X
incr X
while Z not 0:
clear X
decr Z
A: It changes the value of X to 1.
B: If the starting value of X is 0, it sets the value of X to 0. Otherwise, it sets the value of X to 1.
C: If the starting value of X is 0, it sets the value of X to 1. Otherwise, it sets the value of X to 0.
D: It ultimately leaves X the same as it was when the program started.
Explanation / Answer
HI, I have answered last 4 questions.
Please repost Q1 in separate post.
Here I am assuming mod means remainder.
Please let me know in case of any issue.
2.
Ans: -37 mod 23 = 14
So, Answer: None of the above
3.
c = -41 mod 4
= 1 Ans
4. Compute the following modular exponentiation equation
719 mod 100
So, when we divide 719 with 100, we get 19 as remainder
5. Which of the following best describes what the following Bare Bones program does?
copy X to Z
clear X
incr X
while Z not 0:
clear X
decr Z
Ans: C: If the starting value of X is 0, it sets the value of X to 1. Otherwise, it sets the value of X to 0.
So, if X value id 0 then in thsi case it will not enter in while loop. We are incrementing X value from 0 to 1 before
while loop.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.