Divisibility, gcd, and Euclidean algorithm - Discrete Math
- Let be positive integers such that . If , which of the following statements must be true? Answer: divides and Since , we know and . Therefore, . Now we need to show . Suppose is a prime that divides both and . Since , the prime can divide at most one of . Case 1: but . Since and , we have . Since , this means , contradicting . Case 2: but . Since and , we have and . Since , this gives and , contradicting our assumption. Case 3: but . Similar to Case 1, since and , we get , contradiction. Therefore, no prime can divide both and , so . Choice B is wrong because need not be even (consider where is false, so this example doesn't work, but we can construct others). Choice C is wrong because divides , but this doesn't imply . Choice D is wrong because need not divide .
- If and , and both and are positive integers less than 200, how many possible ordered pairs exist? Answer: 2 pairs: and Using gcd(a,b) · lcm(a,b) = ab, we get 15 · 420 = 6300 = ab. Since gcd(a,b) = 15, we can write a = 15m and b = 15n where gcd(m,n) = 1. Then 225mn = 6300, so mn = 28. The pairs (m,n) with gcd(m,n) = 1 and mn = 28 are (1,28), (4,7), (7,4), (28,1). This gives (a,b) pairs: (15,420), (60,105), (105,60), (420,15). But we need both a,b < 200, so (15,420) and (420,15) are excluded. Only (60,105) and (105,60) remain. Choice A is correct.
- Consider the Diophantine equation . Among all integer solutions , let be the solution that minimizes . What are the values of and ? Answer: with First find gcd(84, 90): 90 = 84(1) + 6, 84 = 6(14) + 0. So gcd(84, 90) = 6. The equation becomes 84x + 90y = 6, or equivalently 14x + 15y = 1 (dividing by 6). Using extended Euclidean algorithm on gcd(14, 15): 15 = 14(1) + 1, 14 = 1(14) + 0. So gcd(14, 15) = 1. Working backwards: 1 = 15 - 14(1). So 14(-1) + 15(1) = 1. Therefore x = -1, y = 1 is a particular solution to 14x + 15y = 1. The general solution is x = -1 + 15t, y = 1 - 14t for integer t. We want to minimize x² + y² = (-1 + 15t)² + (1 - 14t)² = 1 - 30t + 225t² + 1 - 28t + 196t² = 2 - 58t + 421t². Taking derivative: d/dt(2 - 58t + 421t²) = -58 + 842t. Setting to 0: t = 58/842 = 29/421 ≈ 0.069. Since t must be integer, try t = 0 and t = 1. For t = 0: (x,y) = (-1, 1), x² + y² = 1 + 1 = 2. For t = 1: (x,y) = (14, -13), x² + y² = 196 + 169 = 365. For t = -1: (x,y) = (-16, 15), x² + y² = 256 + 225 = 481. The minimum occurs at t = 0, giving (x₀, y₀) = (-1, 1) with x₀² + y₀² = 2. Choice B is correct.
- Let . If is the set of all possible values of for , what is and what is the largest element in ? Answer: and largest element is We have 60 = 2² · 3 · 5 and 84 = 2² · 3 · 7. For gcd(n,60) = gcd(n,84), let d = gcd(n,60) = gcd(n,84). Since d divides both 60 and 84, we have d | gcd(60,84) = gcd(2² · 3 · 5, 2² · 3 · 7) = 2² · 3 = 12. So d ∈ {1, 2, 3, 4, 6, 12}. Now we need to check which of these values are actually achievable. If gcd(n,60) = d, then n = dk for some k with gcd(k, 60/d) = 1. Similarly, if gcd(n,84) = d, then n = dm for some m with gcd(m, 84/d) = 1. For both to hold simultaneously, we need gcd(k, 60/d) = gcd(m, 84/d) = 1 and dk = dm, so k = m. This means gcd(k, 60/d) = gcd(k, 84/d) = 1, i.e., gcd(k, lcm(60/d, 84/d)) = 1. We have lcm(60/d, 84/d) = lcm(60,84)/d = (60 · 84)/gcd(60,84)/d = 5040/12/d = 420/d. So we need gcd(k, 420/d) = 1. This is possible for each d ∈ {1,2,3,4,6,12}, so all these values are achievable. Therefore |T| = 6 and the largest element is 12. Choice B is correct.
- In implementing a fast gcd algorithm, we use the identity where are odd. Given , how many factor-of-2 extractions are needed, and what is the gcd of the resulting odd parts? Answer: 3 extractions from first number, 4 from second, When you encounter a fast gcd algorithm problem, you're working with the binary GCD method that efficiently handles powers of 2. The key identity tells us we can factor out powers of 2 separately, then find the gcd of the remaining odd parts. Let's extract factors of 2 from each number. For 1176: (since , , , and 147 is odd). For 1008: (since , , , , and 63 is odd). So we have 3 extractions from the first number and 4 from the second. Now we need . Using the Euclidean algorithm: , then , so . Answer A has the wrong extraction counts (4 and 3 instead of 3 and 4) and wrong odd parts. Answer B correctly identifies the extractions and odd parts but miscalculates their gcd as 3 instead of 21. Answer D has incorrect extraction counts (2 and 3) and doesn't properly extract all factors of 2. Always double-check your division by 2 until you reach odd numbers, and verify your final gcd calculation using the Euclidean algorithm. The binary method's efficiency comes from handling powers of 2 separately.
- Consider positive integers and where and . If for some positive integer , what are the possible values of , and which value occurs when and ? Answer: No such exists since We have a = 25m + 17 and b = 25n + 23 for integers m, n. Then gcd(a,b) = gcd(25m + 17, 25n + 23). Using the property that gcd(x + ky, y) = gcd(x, y), we get gcd(25m + 17, 25n + 23) = gcd(25m + 17 - (25n + 23), 25n + 23) = gcd(25(m-n) + 17 - 23, 25n + 23) = gcd(25(m-n) - 6, 25n + 23). We can continue reducing, but more directly: gcd(25m + 17, 25n + 23) divides any linear combination, including gcd(25m + 17 - (25n + 23), 25n + 23) = gcd(25(m-n) - 6, 25n + 23). Since gcd divides both terms, it divides gcd(25(m-n) - 6, 25) and gcd(25(m-n) - 6, 23). Now gcd(25(m-n) - 6, 25) = gcd(-6, 25) = gcd(6, 25) = 1 since gcd(6,25) = 1. So gcd(a,b) must divide gcd(something, 23). But more systematically: gcd(25m + 17, 25n + 23) = gcd(25m + 17, 25n + 23 - 25m - 17) = gcd(25m + 17, 25(n-m) + 6). This equals gcd(25m + 17, 6) since we can subtract multiples of 25(n-m). Now gcd(25m + 17, 6) = gcd(17, 6) = gcd(17, 6) = gcd(5, 6) = 1. So gcd(a,b) = 1, not 25k for any k ≥ 1. Let's verify with a = 42, b = 73: 42 = 25(1) + 17 ✓, 73 = 25(2) + 23 ✓. gcd(42, 73) = gcd(42, 73-42) = gcd(42, 31) = gcd(42-31, 31) = gcd(11, 31) = 1 since 11 and 31 are both prime and distinct. So indeed gcd(a,b) = 1 ≠ 25k for k ≥ 1. Choice D is correct.
- Consider the equation . Using the extended Euclidean algorithm, one particular solution is . If the general solution is given by for integer , what is the value of ? Answer: 19 First, find using the Euclidean algorithm: , , . So . Now we need to solve . Working backwards with the extended Euclidean algorithm: . So , giving us . For the general solution of , we use the fact that if is a particular solution, then the general solution is and . Therefore, and , so . The other answer choices represent common errors: 28 would result from using instead of , 42 would come from adding the original coefficients (actually this gives 19 too, so this distractor represents a different error), and 56 represents from a computational mistake.
- Let be a prime number and be positive integers such that . If , then which of the following must be true? Answer: or This problem involves the theory of sums of two squares and quadratic residues. We're given that where is prime and . From , we get , which means . Since , we can multiply both sides by : . This means is a quadratic residue modulo . By quadratic reciprocity theory, is a quadratic residue modulo an odd prime if and only if . For : means is even. Since , both and are odd, so . Thus , which works. Therefore, the condition can be satisfied when or when . Choice B is incorrect because if , then is not a quadratic residue mod , so the condition cannot be satisfied. Choice C is not necessarily true; for example, take : we have , , but and . Choice D states , but we showed . These are equivalent only if , which would require . Since is prime and , this would require . But choice D also requires , making it impossible.
- For positive integers and , define . If , then the smallest element of is , and the second smallest element is: Answer: 10 First, since and . So . By Bézout's identity, there exist integers such that . Working backwards: , so . This confirms that 5 can be written as . By the theory of linear Diophantine equations, the set of all integers that can be expressed as (for integers ) is exactly the set of all multiples of . Therefore, consists of all positive multiples of 5, i.e., . The smallest element is indeed , and the second smallest is 10. However, let me double-check that 10 can actually be achieved. We need for some integers . Dividing by 5: . We need a particular solution to this equation. Since , this equation has integer solutions. By inspection or the extended Euclidean algorithm: . So works: ✓. Therefore, the second smallest element is 10. The other choices would correspond to different multiples of 5, but 10 comes immediately after 5 in the sequence of positive multiples of 5.