Homework 8

advertisement
Homework #8
_________________________ ____
Name
Questions:
1. Show that the schema:
((A  B)  T)  ((A  B)  F)
is a tautology by showing that the
expression reduces to T.
Note: We are showing that
something of the form A  B is true
if and only if something of the form
A  B is false. This should add to
your understanding of proof by
contradiction.
2. Algebraically show:
a) that conditional proofs work, i.e.
prove: P  (Q  R)  (P  Q)  R
b) that case analysis proofs work, i.e.
prove: P  (Q  P)  (Q  P).
Justify each step with a law (or
laws).
Answers:
Sec
3. Use case analysis to prove that for
every integer n, n3 + n is an even
integer.
(Recall that an integer is even if it
has the form 2k for some integer k,
and that an integer is odd if it has the
form 2k + 1 for some integer k.)
4. Prove by induction:
when n is a natural number greater
than 2, then 2n > 2n+1.
5. Suppose that we have two
algorithms for solving a particular
type of problem.
(A) Algorithm A solves the problem
in 2n seconds where n is an integer
and is the size of the problem.
(B) Algorithm B solves the problem
in n2 + 1,000,000 seconds.
Show by induction that algorithm B
is faster than algorithm A for all
problem sizes greater than 19.
Hint: 2n > 2n+1 for n > 2, as proved
in Problem 4, may be useful in this
proof.
6. Prove by induction:
if a truth table has k variables, it has
2k rows.
7. Define E-expressions as follows:
(a) 2, 3, 4 ... are E-expressions.
These E-expressions are called
atomic.
(b) If x and y are E-expressions, so
are (x + y) and (x * y).
E-expressions are evaluated in the
normal way. Show by induction that
the value of every E-expression is at
least 2n, where n is the number of
atomic expressions.
Hint: Let val(E) be the value of E
and let #E be the number of atomic
expressions in E.
Download