3. Compute the GCD of the following pairs of numbers.
a. 16 and 514 b. 21 and 134 c. 91 and 17
using prime factorizationa
1)16 and 514
16=2*2*2*2
514 = 2*257
Common factor =2 which is the GCD
2)21 and 134
21 = 7*3
134 = 2*67
No common factor, GCD = 1
3)91 and 17
17 = 17
91 = 13*7
No common factor, GCD = 1
3. Compute the GCD of the following pairs of numbers. a. 16 and 514 b. 21...
1 For each of the following pairs of numbers a and b, calculate and find integers r and s such ged (a; b) by Eucledian algorithm that gcd(a; b) = ra + sb. ia= 203, b-91 ii a = 21, b=8 2 Prove that for n 2 1,2+2+2+2* +...+2 -2n+1 -2 3 Prove that Vn 2 1,8" -3 is divisible by 5. 4 Prove that + n(n+1) = nnīYn E N where N is the set of all positive integers....
Write a C++ class to compute the GCD and LCM. The class should be able to store the two numbers to compute their GCD and LCM. The class should have the following methods: - void setNumbers(int, int); - int getGCD(void); - int getLCM(void); You may use a constructor instead of setNumbers method. Also write a simple C++ program that will implement the class above.
3. Use Euclid's algorithm to compute the following. Show all your steps 1. gcd(781, 994) 2. gcd(67457, 43521)
7. Consider the six numbers: 3, 5, 8, 15, 20, 21, 24 (a) Compute the mean T and median m of the six numbers. (b) Apply the logarithm to the data (in R, use command 1n), and then compute the mean T and median m' of the transformed data. (c) Is In(1)-z'? Is In(m) = m'?
Write an alternative gcd algorithm based on the following observations (arrange so that a > b): a. gcd(a, b) = 2gcd(a/2, b/2) if a and b are both even. b. gcd(a, b) = gcd(a/2, b) if a is even and b is odd. c. gcd(a, b) = gcd(a, b/2) if a is odd and b is even. d. gcd(a, b) = gcd((a + b)/2, (a ? b)/2) if a and b are both odd
4 Let R2 be the set of all ordered pairs of real numbers equipped with the operations: addition defined by (21,02) (91, 92) = (21 41, 22 y2) and scalar multiplication defined by c(x1,22) = (cx1,Cx2), herece R is a scalar. Note that the operation addition here is non standard. Is R’ in this case a vector space ? (Justify your answer)
Consider the following C codes to compute the gcd of two integers. /// code 1 #include <stdio.h> int gcd(int a, int b) { while (a != b) { if (a > b) a = a - b; else b = b - a; } return a; } /// code 2 #include <stdio.h> int getint() { int i; scanf("%d", &i); return i; } void putint(int i) { printf("%d\n", i); } int main()...
16. Given complex numbers 21 = 3 – 7i and z2 = -1+9i, find the absolute value of (3z1 + 2z2): | 3z1 + 2z2 = ? (16)
discrete math Search il 17:16 [Problem] 1 (a) Give an external definition of the set S {sls EZA+ and gcd(x, 12) 1) (B) Write all the proper subsets of the set {1, 2 3}, and (c) define the function for real number a and positive integer n ,f: RxZ^+ R as f (a,n) a^n , Give a recursive definition of the function (d) Calculate gcd (60, 22) using Euclidean algorithm (e) Give 3 positive integer x that satisfies 4x 6...
Calculate A+B, and A-B for the following pairs of binary numbers using 2's complement. Choose the N value to be 1 more than the minimum necessary to perform the task. C) 1012 , 10112 D) 101101102,010110112