Math 301

Math 301

Quiz 4


Justify all answers with neat and organized work. Clearly indicate your answers. 20 points possible.


1. (5 pts.) Let A be the set of all integers from 1 through 1,000 that are multiples of 4 or multiples of 11. How many elements are in A?

2. (5 pts.) Determine how many times the innermost loop will be iterated when the algorithm segment is implemented and run.


for i:=15 to 80

for j:=30 to 60

[Statements in body of inner loop. None contain branching statements that lead outside the loop.]
next j

next i

3. (5 pts.) Suppose A[1], A[2], ..., A[2n], is a one-dimensional array and n ³ 2. What is the probability that a randomly chosen array element is in the subarray
A[1], A[2], ..., A[ë3n/2û]
(a) if n is even?

(b) if n is odd?

4. (5 pts.) Let B={n Î Z | 1 £ n £ 400}.


(a) How many even integers are in B?

(b) How many odd integers are in B?

(c) How many ways can two different integers be selected from B so that their sum is even?

(d) How many ways can two different integers be selected from B so that their sum is odd?




File translated from TEX by TTH, version 2.92.