Discrete Structure Quiz 3 Part 1

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

For each of these functions, find the least integer n such that f(x) is O(x^n). If f(x) = (x4+x2+1) / (x4+1) then the least integer n is ____

0

Arrange the steps in the correct order to prove that 21 divides 4n + 1 + 52n − 1 whenever n is a positive integer. Rank the options below. Hence, 21 | (4^((k + 1) + 1) + 5^(2(k + 1) − 1)), and by mathematical induction, 21 | (4^(n + 1) + 5^(2n - 1) ) whenever n is a positive integer. For the inductive hypothesis, suppose that 21 | (4^(k + 1) + 5^(2k − 1)). 4 · 4^(k + 1) + (4 + 21) · 5^(2k - 1) = 4(4^(k + 1) + 5^(2k - 1)) + 21 · 5^(2k - 1) 4^((k + 1) + 1) + 5^(2(k + 1) − 1) = 4 · 4^(k + 1) + 25 · 5^(2k - 1) The term 4(4^(k + 1) + 5^(2k - 1)) is divisible by 21 according to the inductive hypothesis, and the term 21 · 5^(2k - 1) is clearly divisible by 21. As 21 | 4^(1 + 1) + 5^(2 · 1 - 1) = 21, the basis step is true. 4 · 4^(k + 1) + 25 · 5^(2k - 1) = 4 · 4^(k + 1) + (4 + 21) · 5^(2k - 1)

1. As 21 | 4^(1 + 1) + 5^(2 · 1 - 1) = 21, the basis step is true. 2. For the inductive hypothesis, suppose that 21 | (4^(k + 1) + 5^(2k − 1)). 3. 4^((k + 1) + 1) + 5^(2(k + 1) − 1) = 4 · 4^(k + 1) + 25 · 5^(2k - 1) 4. 4 · 4^(k + 1) + 25 · 5^(2k - 1) = 4 · 4^(k + 1) + (4 + 21) · 5^(2k - 1) 5. 4 · 4^(k + 1) + (4 + 21) · 5^(2k - 1) = 4(4^(k + 1) + 5^(2k - 1)) + 21 · 5^(2k - 1) 6. The term 4(4^(k + 1) + 5^(2k - 1)) is divisible by 21 according to the inductive hypothesis, and the term 21 · 5^(2k - 1) is clearly divisible by 21. 7. Hence, 21 | (4^((k + 1) + 1) + 5^(2(k + 1) − 1)), and by mathematical induction, 21 | (4^(n + 1) + 5^(2n - 1) ) whenever n is a positive integer.

Arrange the given steps in the correct order to prove that 3n<n!3n<n! if n is an integer greater than 6, using mathematical induction. Rank the options below. 3^(k+1) < (k+1) ⋅ 3^k Suppose that for some k > 6, 3^k < k! 3^(k+1) < (k+1)! 3^(k+1) < (k+1) ⋅k! For n = 7, 3^7 = 2187 < 7! = 5040. 3^(k+1) = 3 ⋅ 3^k

1. For n = 7, 3^7 = 2187 < 7! = 5040. 2. Suppose that for some k > 6, 3^k < k! 3. 3^(k+1) = 3 ⋅ 3^k 4. 3^(k+1) < (k+1) ⋅ 3^k 5. 3^(k+1) < (k+1) ⋅k! 6. 3^(k+1) < (k+1)!

Let P(n) be the statement that 1^3+ 2^3+ 3^3+ ... + n^3 = (n(n+ 1) / 2)^2 for the positive integer n. We will have completed the basis step of the proof if we show that (Check all that apply.) 1. P(1) is true. 2. P(0) is true. 3. P(1) → P(2) is true. 4. 1^3 + 2^3 + ... + n^3 = (n(n+1) / 2)^2 is true for n = 1. 5. 1^3 + 2^3 + ... + n^3 = (n(n+1) / 2)^2 is true for some integer n.

1. P(1) is true. 4. 1^3 + 2^3 + ... + n^3 = (n(n+1) / 2)^2 is true for n = 1.

Arrange the steps in the correct ascending order to devise a variation of the insertion sort that uses a linear search technique that inserts the jth element in the correct place by first comparing it with the (j − 1)st element, then the (j − 2)th element if necessary, and so on. (You must provide an answer before moving to the next part.) Rank the options below. for j := 2 to n a i + 1 := m ai + 1 := ai i := i - 1 m := aj i := j - 1 procedure backward insertion sort(a1, a2, . . . , an : real numbers with n ≥ 2) while (m < ai and i > 0)

1. procedure backward insertion sort(a1, a2, . . . , an : real numbers with n ≥ 2) 2. for j := 2 to n 3. m := aj i := j - 1 4. while (m < ai and i > 0) 5. ai + 1 := ai i := i - 1 6. a i + 1 := m

Arrange the steps in the correct order to devise an algorithm that finds all the terms of a finite sequence of integers that are greater than the sum of all the previous terms of the sequence. Rank the options below. sum := sum + ai i := i + 1 return L {the list of all the values that exceed the sum of all the previous terms in the sequence} set L to be the empty list sum := 0 i := 1 procedure find all biggies(a1, a2, ..., an : integers) while i ≤ n if ai > sum then append ai to L

1. procedure find all biggies(a1, a2, ..., an : integers) 2. set L to be the empty list sum := 0 i := 1 3. while i ≤ n 4. if ai > sum then append ai to L 5. sum := sum + ai i := i + 1 6. return L {the list of all the values that exceed the sum of all the previous terms in the sequence}

Rearrange the following steps in the correct order to find the smallest integer in a finite sequence of natural numbers. Rank the options below. min := a1 min := a1min {the smallest integer among the input} if ai < min then min := ai for i := 2 to n procedure smallest(a1, a2, . . . , an : natural numbers)

1. procedure smallest(a1, a2, . . . , an : natural numbers) 2. min := a1 3. for i := 2 to n 4. if ai < min then min := ai 5. return min {the smallest integer among the input}

Give a big-O estimate for each of these functions. For the function g in your estimate f (x) is O(g(x)), use a simple function g of smallest order. If f(x) = (2n + n2)(n3 + 3n) then, g(x) = _____. 2^n 6^n 5^n 3^n

6^n

Let P(n) be the statement that a postage of n cents can be formed using just 4-cent stamps and 7-cent stamps. The parts of this exercise outline a strong induction proof that P(n) is true for n ≥ 18. Show that the statements P(18), P(19), P(20), and P(21) are true, completing the basis step of the proof. (Please enter your answers as numeric values only.) (You must provide an answer before moving to the next part.) P(18) is true, because 18 cents of postage can be formed from ___ 4-cent stamps and ___ 7-cent stamps. P(18) is true, because 19 cents of postage can be formed from ___ 4-cent stamps and ___ 7-cent stamps. P(18) is true, because 20 cents of postage can be formed from ___ 4-cent stamps and ___ 7-cent stamps. P(18) is true, because 21 cents of postage can be formed from ___ 4-cent stamps and ___ 7-cent stamps.

P(18) = 1, 2 P(19) = 3, 1 P(20) = 5, 0 P(21) = 0, 3

Use strong induction to show that every positive integer n can be written as a sum of distinct powers of two, that is, as a sum of a subset of the integers 2^0 = 1, 2^1 = 2, 2^2 = 4, and so on. Let P(n) be the proposition that the positive integer n can be written as a sum of distinct powers of 2. Which is the correct basis step? (You must provide an answer before moving to the next part.) Multiple Choice a. P(1) states that 1 can be written as a sum of distinct powers of 2, which is true because 1 = 2^0. b. P(1) states that 1 can be written as a sum of distinct powers of 2, which is true because 1 = 2^0 + 2^1. c. P(0) states that 0 can be written as a sum of distinct powers of 2, which is true because 0 = 2^0. d. P(0) states that 0 can be written as a sum of distinct powers of 2, which is true because 0 = 2^0 + 2^0.

a. P(1) states that 1 can be written as a sum of distinct powers of 2, which is true because 1 = 2^0.

Use strong induction to show that every positive integer n can be written as a sum of distinct powers of two, that is, as a sum of a subset of the integers 2^0 = 1, 2^1 = 2, 2^2 = 4, and so on. Let P(n) be the proposition that the positive integer n can be written as a sum of distinct powers of 2. Identify the inductive hypothesis that proves P(n) is true. (You must provide an answer before moving to the next part.) Multiple Choice a. Every positive integer up to k - 1 can be written as a sum of distinct powers of 2. b. Every positive integer up to k + 1 can be written as the distinct powers of 2. c. Every positive integer up to k can be written as a sum of distinct powers of 2. d. Every positive integer up to k + 1 can be written as a sum of distinct powers of 2. e. Every positive integer up to k can be written as a difference of distinct powers of 2.

c. Every positive integer up to k can be written as a sum of distinct powers of 2.

Find the flaw with the following "proof" that every postage of 3 cents or more can be formed using just 3-cent and 4-cent stamps. Basis Step: We can form postage of 3 cents with a single 3-cent stamp, and we can form postage of 4 cents using a single 4-cent stamp. Inductive Step: Assume that we can form postage of j cents for all nonnegative integers j with j ≤ k using just 3-cent and 4-cent stamps. We can then form postage of k + 1 cents by replacing one 3-cent stamp with a 4-cent stamp or by replacing two 4-cent stamps by three 3-cent stamps. Which of these statements describes a flaw in the proof? Multiple Choice a. The inductive step fails for k = 3 because 3 cents of postage includes neither a 4-cent stamp nor two 4-cent stamps; so, neither proposed replacement is possible. b. The inductive step fails for k = 8 because no 3-cent stamps are used to form 8 cents of postage, so neither proposed replacement is possible. c. The inductive step fails for k = 4 because 5 cents of postage includes neither a 3-cent stamp nor two 4-cent stamps; so, neither proposed replacement is possible. d. The inductive step fails for k = 6 because no 4-cent stamps are used to form 6 cents of postage, so neither proposed replacement is possible.

c. The inductive step fails for k = 4 because 5 cents of postage includes neither a 3-cent stamp nor two 4-cent stamps; so, neither proposed replacement is possible.

procedure sum(n : positive integer)sum := 0while i < 10 sum := sum + i a. definiteness b. input c. output d, finiteness

c. input

Which of the following functions are O(x^2)? xlogx x^4 + x^2 + 1 2^x x^4+x^2+ 1 / x+1

xlogx


Ensembles d'études connexes

AP Human Geography - Unit 5 Review Questions

View Set

Chapter 26: Growth and Development of the Toddler

View Set

ATI TEAS Anatomy & Physiology: Skeletal System

View Set

Managerial Accounting - Chapter Three

View Set

Primerica - UCANPASS - Chapter Taxes, Retirement and Other Insurance Concepts

View Set

Chapter 2: Family-Centered Community-Based Care

View Set