Question

In: Computer Science

Find the greatest common divisor d = gcd(527, 341). Show all calculation steps. We assume that...

Find the greatest common divisor d = gcd(527, 341). Show all calculation steps.

We assume that the modulus is a positive integer. But the definition of the
expression a mod n also makes perfect sense if n is negative. Determine the following:

a. 7 mod 4
b. 7 mod -4
c. -7 mod 4
d. -7 mod -4

Solutions

Expert Solution

We can use the Euclidean Algorithm here to find GCD of two numbers.

  • If X = 0 then GCD(X,Y)=Y, since the GCD(0,Y)=Y, stop.
  • If B = 0 then GCD(X,Y)=X, since the GCD(X,0)=X, stop.
    • Write X in quotient remainder form (X= Y⋅P + D) where P is quotient and D is remainder
  • Find GCD(Y,R) using the Euclidean Algorithm since GCD(X,Y) = GCD(Y,R)

GCD(527,341) =
X = 527, Y = 341
X ≠ 0 , Y ≠ 0
527 = 341 * 1 + 186
GCD(527,341) = GCD(341,186)

Again,
GCD(341,186)
X = 341, Y = 186
X ≠ 0 , Y ≠ 0
341 = 186 * 1 + 155
GCD(341,186) = GCD(186,155)

GCD(186, 155)
X = 186, Y = 155
X ≠ 0 , Y ≠ 0
186 = 151 * 1 + 31
GCD(186,155) = GCD(155,31)

GCD(155,31)
X = 155, Y = 31
X ≠ 0 , Y ≠ 0
155 = 31 * 5 + 0
GCD(155,31) = GCD(31,0)

And by Euclidean algorithm GCD(31, 0 ) = 31

Hence GCD(527, 341 ) = 31.

The modulus of the follwing:

X mod Y : X = Y*A + R (where A is quotient and R is remainder) R is the answer
But if Y is negative then X mod Y = M , X mod -Y = -(Y-M)
a) 7 mod 4 -> 7 = 4 * 1 + 3 = 3
b) 7 mod -4 -> 7 mod 4 = 3 , Using above -(4-3) = -1
c) -7 mod 4 -> -7 = 4*-2 + 1 = 1
d) -7 mod -4 -> -7 = -4 *1 +(-3) = -3


Related Solutions

3. In mathematics, the greatest common divisor (gcd), sometimes known as the greatest common factor (gcf)...
3. In mathematics, the greatest common divisor (gcd), sometimes known as the greatest common factor (gcf) or highest common factor (hcf), of two non-zero integers, is the largest positive integer that divides both numbers. The greatest common divisor of a and b is written as gcd (a, b), or sometimes simply as (a, b). For example, gcd (12, 18) = 6, gcd (−4, 14) = 2 and gcd (5, 0) = 5. Two numbers are called co-prime or relatively prime...
Let m, n be natural numbers such that their greatest common divisor gcd(m, n) = 1....
Let m, n be natural numbers such that their greatest common divisor gcd(m, n) = 1. Prove that there is a natural number k such that n divides ((m^k) − 1).
A. 271 and 516 1.  Find the greatest common divisor, d, of the two numbers from part...
A. 271 and 516 1.  Find the greatest common divisor, d, of the two numbers from part A using the Euclidean algorithm. Show and explain all work. 2.  Find all solutions for the congruence ax ? d (mod b) where a and b are the integers from part A and d is the greatest common divisor from part A1. Show and explain all work.
Let a and b be positive integers, and let d be their greatest common divisor. Prove...
Let a and b be positive integers, and let d be their greatest common divisor. Prove that there are infinitely many integers x and y such that ax+by = d. Next, given one particular solution x0 and y0 of this equation, show how to find all the solutions.
4. (a) Use the Euclidean algorithm to find the greatest common divisor of 21 and 13,...
4. (a) Use the Euclidean algorithm to find the greatest common divisor of 21 and 13, and the greatest common divisor of 34 and 21. (b) It turns out that 21 and 13 is the smallest pair of numbers for which the Euclidean algorithm requires 6 steps (for every other pair a and b requiring 6 or more steps a > 21 and b > 13). Given this, what can you say about 34 and 21? (c) Can you guess...
All necessary steps much show for these problems, please. Use the Euclidean algorithm to find gcd(12345,...
All necessary steps much show for these problems, please. Use the Euclidean algorithm to find gcd(12345, 54321). Write gcd(2420, 70) as a linear combination of 2420 and 70. The work to obtain the gcd is provided. 2420 = 34(70) + 40 70 = 1(40) + 30 40 = 1(30) + 10 30 = 3(10) + 0 Determine if 1177 is prime or not. If it is not, then write 1177 as a product of primes Find gcd(8370, 465) by unique...
Please show all the steps of calculation. The following are the financial statements for Patriots and...
Please show all the steps of calculation. The following are the financial statements for Patriots and Jets Companies for 2018: Statements of Financial Position Patriots Jets Cash $  25,000 $  45,000 Accounts receivable (net) 55,000 5,000 Inventory 110,000 25,000 Property, plant, and equipment (net) 550,000 160,000 Other long-term assets 140,000 57,000 Total assets $880,000 $292,000 Accounts payable $110,000 $  10,000 Salaries payable 10,000 5,000 Current liabilities $120,000 $  15,000 Long-term liabilities 190,000 55,000 Total liabilities $310,000 $  70,000 Common shares 530,000 214,000 Retained earnings 40,000...
Perform all the steps for ALL PARTS (a - d) in R code and show and...
Perform all the steps for ALL PARTS (a - d) in R code and show and explain the results. Thank you. Problem 2.23 Consider the simple linear regression model y = 50 + 10x + E where E is NID(0,16). Suppose that the n = 20 pairs of observations are used to fit this model. Generate 500 samples of 20 observations, drawing one observation for each level of x = 0.5,1, 1.5, 2, ..., 10 [i.e. going up by an...
Show that he gcd of 63 and 40 is 1 and find all integer solutions: 63s...
Show that he gcd of 63 and 40 is 1 and find all integer solutions: 63s + 40t = 1. Use the Euclidean algorithm to find the gcd. Then back solve to find s and t. To get full credit, use the format shown in the post below titled Bezout's Theorem. (See the example where we find the gcd of 18 and 5.) Bézout's theorem says "If  d is the gcd of m and n then we can find integers s...
Find all the subgroups of the group of symmetries of a cube. Show all steps. Hint:...
Find all the subgroups of the group of symmetries of a cube. Show all steps. Hint: Label the diagonals as 1, 2, 3, and 4 then consider the rotations to get the subgroups.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT