You are on page 1of 2

Discrete Mathematics with Applications (Spring 2024) Homework: 03

ICSI 521 – Discrete Mathematics with Applications

Instructor: Abram Magner Date: Spring 2024

Instructions: Please answer the following questions in complete sentences, showing all work
(including code and output of programs, when applicable). Your solutions MUST be typed (e.g.,
using LaTeX, with Overleaf, TeXworks, etc., or Word).
Every submission must be in either pdf or Word format.
Due date: Thursday, 3/14/2024, 11:59 p.m.

3.1 Induction
1. Prove the following claim by induction:
Claim 3.1. For all n ∈ Z ∩ [0, ∞), we have
n 
1 j 2n+1 + (−1)n
X 
− = . (3.1)
2 3 · 2n
j=0

2. Consider the following pseudocode, which returns the index of the largest element in the input
array.

def argmax(int []array):


if length(array) == 1:
// Base case.
return(0);
else:
// array has length > 1.
tailArray = array[1:];
// tailArray is array with its 0th element removed.
tailIndex = 1 + argmax(tailArray);
if array[tailIndex] <= array[0]:
return 0;
else:
return tailIndex;
end
end
end

Let n denote the length of the input array, and assume that n ⩾ 1. Prove by induction on n
that argmax(array) returns the index of the maximum element of its argument.

3-1
3-2 Homework 03: ICSI 521 – Discrete Mathematics with Applications

3. Give a detailed explanation of what is logically wrong with the following inductive “proof”:

Claim 3.2. For every positive integer n, if x and y are positive integers with max(x, y) = n,
then x = y. Here, max(x, y) denotes the larger of x and y.

Proof. We prove this by induction.


Base case: n = 1. if max(x, y) = 1 and x and y are positive integers, then we must have
x = 1 and y = 1.
Inductive step: Assume that the claim is true for n = k. We need to verify for n = k + 1.
That is, assume that whenever max(x, y) = k where x, y are positive integers, we have x = y.
Now suppose max(x, y) = k + 1 and x, y are positive integers. Then

max(x − 1, y − 1) = k, (3.2)

so by the inductive hypothesis, x − 1 = y − 1, and so x = y, which completes the proof. ■

3.2 Counting bit strings with constraints

Answer the following questions. For each one, give a detailed justification of your answer.
1. How many bit strings of length 12 contain exactly 3 ones?

2. How many bit strings of length 12 contain the same number of 0s and 1s?

3.3 Counting permutations, combinations, inclusion-exclusion

Answer the following questions. For each one, give a detailed justification of your answer.
1. How many ways are there to arrange the letters a, b, c, d in such a way that a is not followed
immediately by b?

2. How many positive integers less than or equal to 100 are divisible by 2 or 3? Recall that x is
divisible by y (or, equivalently, y | x) if there exists h ∈ Z such that x = hy.
Hint: Use inclusion-exclusion.

3. How many permutations of {a, b, c, d, e, f, g} end with a?

4. A professor writes 40 discrete math true/false questions. Of the statements in these questions,
17 are true. If the questions can be positioned in any order, how many different answer keys
are possible?

You might also like