# Discrete Mathematics : Integer Algorithms, GCD, Solving Congruences and Diagonal Matrices

4. Describe an algorithm that takes as input a list of n integers and produces as output the largest difference between consecutive integers in the list.

Integers

28. What is the greatest common divisors of these pairs of integers?

a) 22 * 33 * 55, 25 * 33 * 52

b) 2 * 3 * 5 * 7 * 11 * 13, 211 * 39 * 11 * 1714

c) 17, 1717

d) 22 * 7, 53 * 13

e) 0, 5

f) 2 * 3 * 5 * 7, 2 * 3 * 5 * 7

Number Theory

18. Find all solutions to the system of congruences.

x = 2(mod 3)

x = 1(mod 4)

x = 3(mod 5)

Matrices

14. The n x n matrix A = [aij] is called a diagonal matrix if aij = 0 when i ≠ j. Show that the product of two n x n diagonal matrices is again a diagonal matrix. Give a simple rule for determining this product.

For each topic, demonstrate a knowledge and capability by giving the following information:

1) Problem Solution: (solution for an even number problem) see below...

2) Personal Observation: (personal comment on the topic including advice to others on how to study and understand it).

© BrainMass Inc. brainmass.com October 9, 2019, 5:24 pm ad1c9bdddfhttps://brainmass.com/math/matrices/56550

#### Solution Preview

4.)

do (i=1 to n) { read a[i]}

max_diff = 0.0

do (i=2 to n)

{ diff = |a[i] - a[i-1] |

if diff > max_diff then max_diff = diff }

Print max_diff

28.)

Take corresponding to each prime factor, highest common index (e.g., 2^3 and 2^5: GCD = 2^3)

a.)

2^2 * 3^3 * 5^5, 2^5 * 3^3 * 5^2

greatest common factors: 2^2 * 3^3 * 5^2 = 2700 --Answer (common indices of 2: 2, of 3: 3, of 5: 2)

b)2 * 3 * 5 * 7 * 11 * 13, 2^11 * 3^9 * 11 * ...

#### Solution Summary

Integer Algorithms, GCD, Solving Congruences and Diagonal Matrices are investigated. The solution is detailed and well presented. The response received a rating of "5/5" from the student who originally posted the question.