0% found this document useful (0 votes)
3 views

answers_exam_1

Uploaded by

Anuj Jha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

answers_exam_1

Uploaded by

Anuj Jha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Math 4/5/7380: Answers to exam 1

23 September 2013

Definitions, theorems, history


Provide short, precise answers to the following. Use complete sentences!

1. Stirling’s Formula says that



n! ∼ (n/e)n · 2πn.

What does the ∼ mean? What is the difference between ∼ and ≈?


We say that an ∼ bn when lim an /bn = 1. We say that an ≈ bn when
lim(an − bn ) = 0.

2. What is the FISA court? When and why was the FISA court created?
This is the court established by the Foreign Intelligence Surveillance
Act of 1978. It was one of the recommendations of the committee
chaired by Senator Frank Church. His committee investigated abuses
and illegal actions of various intelligence agencies during the Cold War,
especially under the Nixon administration. The court allows the NSA,
CIA, FBI and others to obtain warrants for surveillance of foreign
agents (including US citizens suspected of aiding foreign governments)
without revealing secrets to the public, as might happen in other Fed-
eral courts.

1
3. State the Binomial Theorem. Who discovered it?
The Binomial Theorem states that if n is a nonnegative integer then
n  
n
X n
(x + y) = xn−k y k .
k=0
k

It seems to have been first stated (but not in the form above!) by the
Persian poet and mathematician Omar Khayyam, who lived in the late
11th and early 12th centuries.

4. What is the method of simultaneous induction? Give an example of


statements that can be proved with this method.
Simultaneous induction is used to prove two sequences of statements
An and Bn simultaneously by induction, using a scheme such as the
following:

An and Bn =⇒ An+1
An+1 and Bn =⇒ Bn+1

After establishing base cases for both sequences we conclude the truth
of all An and Bn .
The book uses this method to prove the following two statements by
simultaneous induction:

An : Fn2 + Fn−1
2
= F2n−1
Bn : Fn+1 Fn + Fn Fn−1 = F2n

5. What is the Law of Large Numbers? Be precise!


The Law of Large Numbers can be stated in various ways. One way
echoes the Binomial Theorem:

If 0 ≤ t ≤ m then the probability that out of 2m coin tosses


the number of heads differs from m by more than t (in abso-
2
lute value) is less than e−t /(m+t) .

2
Python
6. What does the following compute?

def spam(b,n):
if n == 0:
return 1
else:
x = spam(b,n/2)**2
if n%2 == 1:
x = b*x
return x

Work through an example by hand, showing how each variable changes


as the code executes.
Notice that the value of b never changes. Hence we will not track it.
Now to compute (say) spam(b,7) we would have to compute spam(b,3),
which in turn would require spam(b,1), and that would lead finally to
spam(b,0), which simply returns the value 1. Working backwards we
find that the variable x gets the following values:

spam(b,0) spam(b,1) spam(b,3) spam(b,7)


1 → 1
b → b2
b3 → b6
b7

Thus it appears that that spam(b, n) = bn . We can prove this by


induction. If n = 0 then spam(b, 0) = 1 = b0 . Suppose n > 0. If
n = 2m then by induction we find that

spam(b, n) = (spam(b, m))2 = (bm )2 = b2m = bn .

Similarly if n = 2m + 1 then by induction we find that

spam(b, n) = b · (spam(b, m))2 = b · (bm )2 = b2m+1 = bn .

3
7. Write a recursive python function to compute gcd(a, b) based on the
identity
b > 0 =⇒ gcd(a, b) = gcd(b, a mod b).
(Recall that a mod b is the remainder of a ÷ b.) Convert your function
to an iterative python function.
The identity above translates directly into python.

def rgcd(a,b):
"recursive computation of gcd(a,b)"
if b > 0:
return rgcd(b,a%b)
else:
return a

Notice that at each recursive stage the only computation is to exchange


the pair (b, a%b) for (a, b). Hence one way to translate the above code
into an iterative on is

def igcd(a,b):
"iterative computation of gcd(a,b)"
while b > 0:
a,b = b,a%b
return a

Computations
8. Find the number of 20-digit integers in which no 2 consecutive digits
are the same. Justify your answer!
We imagine a decision tree where we choose the digits from most sig-
nificant to least (that is, left to right). Since this is to be a 20-digit
integer the leading digit can be anything except 0. Having just chosen
a particular digit we can choose any of the remaining 9 digits for the
next least significant. Thus there are 920 leaves in this tree.

4
9. In how many ways can you distribute n pennies to k boys and ` girls if
each boy must get at least 1 penny and each girl must get at least 2?
If we were only required to give at least 1 penny to each of the children
then we could solve this as follows. Line up the pennies and imagine
dividing them into k groups. There are k − 1 divisions and these can be
chosen from among any of the n − 1 gaps between the pennies. Hence
the answer would be n−1k−1
in this case.
In our case we can apply the above solution by first distributing 1 penny
to each of the ` girls. This will leave n − ` pennies to distribute to each
of the k + ` children in such a way that each child gets at least 1 of
these. Thus, the number  of ways to distribute the pennies according
to these rules is n−`−1
k+`−1
.

Proofs
10. Give an inductive proof of the identity
n  
X n k
2 = 3n .
k=0
k

When n = 0 the equation reads 00 20 = 30 , which is true. Now suppose




that n > 0. By the induction hypothesis we find that


n   n−1    
X n k
X n−1 n−1
2 =1+ + 2k + 2n
k=0
k k=1
k − 1 k
  n−1  
n−1 0 X n−1 k
= 2 + 2
0 k=1
k
n−2
X n − 1
  
k+1 n − 1 n−1+1
+ 2 + 2
k=0
k n − 1
= 3n−1 + 2 · 3n−1
= 3n .

5
11. Give a combinatorial proof of the identity in the previous problem.
The right-hand side of the equation counts the number of strings of
length n on three symbols — say 0, 1, and 2. The left-hand side counts
the n + 1 disjoint cases where we first choose how many nonzero entries
to include in the string; and then, having decided to include k nonzero
entries, choosing the particular k places for them; then amongst those
k places choosing some subset where we place the 1s. A bit artificial,
but there it is!

You might also like