Docsity

Prime Factor Examples - Applied Discrete Mathematics - Assignment, Exercises of Discrete Mathematics

Toggle sidebar
bg1
CS 320L – Applied Discrete Mathematics – Spring 2013
Assignment #2
Posted on March 8 – due by March 26, 4:00pm
Question 1: Everything is Relative
a) Write a program in Java, C or C++ that outputs for a given positive integer n a list of
all integers m with 1 < m < n so that m and n are relatively prime. For example, for
input 10, your program should output 3, 7, 9. Attach a printout of your program to
your assignment, and e-mail the code to our TA Andrew Eckel: [email protected].
b) Use your program to find the smallest integer n for which there are exactly 19
integers m with 1 < m < n so that m and n are relatively prime. Write down this
integer n and the ten integers with which it is relatively prime.
Question 2: Prime Factor Examples
Write down the prime factorization (with primes listed in ascending order) of each of the
following integers (Example: 720 = 24325).
a) 444
b) 1025
c) 41
d) 3072
Question 3: Euclid’s Legacy
Use the Euclidean algorithm to determine the following greatest common divisors. Write
down every step in your calculation.
a) gcd(810, 422)
b) gcd(945, 505)
Docsity.com
pf3

Partial preview of the text

Download Prime Factor Examples - Applied Discrete Mathematics - Assignment and more Exercises Discrete Mathematics in PDF only on Docsity!

CS 320L – Applied Discrete Mathematics – Spring 2013

Assignment

Posted on March 8 – due by March 26, 4:00pm

Question 1: Everything is Relative

a) Write a program in Java, C or C++ that outputs for a given positive integer n a list of all integers m with 1 < m < n so that m and n are relatively prime. For example, for input 10, your program should output 3, 7, 9. Attach a printout of your program to your assignment, and e-mail the code to our TA Andrew Eckel: [email protected].

b) Use your program to find the smallest integer n for which there are exactly 19 integers m with 1 < m < n so that m and n are relatively prime. Write down this integer n and the ten integers with which it is relatively prime.

Question 2: Prime Factor Examples

Write down the prime factorization (with primes listed in ascending order) of each of the following integers (Example: 720 = 2^4  32 5).

a) 444 b) 1025 c) 41 d) 3072

Question 3: Euclid’s Legacy

Use the Euclidean algorithm to determine the following greatest common divisors. Write down every step in your calculation.

a) gcd(810, 422) b) gcd(945, 505)

Question 4: Matrices Reloaded

a) Is there a matrix M such that when multiplied by itself, we get

M  M 

If there is no such matrix M , prove it. Otherwise, determine and write down M.

b) Is there a matrix M that is not an identity matrix, does not only contain zeroes, and for which MM = M? Either provide such a matrix M or prove that it does not exist.

c) Find a zero-one matrix A so that the following equation becomes true, where “°” is the Boolean multiplication symbol:

 A

Explain how you obtained your solution.

Question 5: Rules of Inference

Use rules of inference to show whether the following arguments are valid or not. Some cases may require predicates and/or quantification, and others may not. Write down every step of your reasoning as we did in class. If you find that an argument is not valid, provide an example for which the argument fails.

a) There is at least one Red Sox player who drives a BMW. All BMW drivers like eating sauerkraut. Therefore, there is at least one Red Sox player who likes eating sauerkraut.

b) Whenever Paul goes to the UMB Cafeteria, he either gets pizza or sushi. Whenever he eats pizza, he gets sleepy. Whenever he eats sushi, he gets thirsty. Paul went to the UMB Cafeteria, and he does not get thirsty. Therefore, he gets sleepy.

c) All C programmers like watching Star Trek. Whoever watches Star Trek also likes the Hobbit movie. George does not like the Hobbit movie. Therefore, George is not a C programmer.

d) If it snows heavily, UMB will be closed. If UMB is closed, the students are bored. The students are bored. Therefore, it snowed heavily.