CMSC 250 Fall 2004 -- Homework 12 Answer
Due Wed., Nov. 24 at the beginning of your discussion section.
You must write the solutions to the problems single-sided on your own lined paper, with all sheets stapled together, and with all answers written in sequential order or you will lose points.
- In a 3-dimensional world, whenever you stand in
position
, you can proceed one of the positions
,
and
. How many ways can you walk from the starting
position
to the exit
?
Answer:
Observe that whatever way to walk from (0,0,0) to (10,10,10) it must involve
exactly 30 steps, while 10 out of 30 are on
-axis and 10 out of the
remaining 20 are on
-axis, and the remaining 10 on the z axis.
Therefore these steps can be taken in any order but the
steps in the same direction are indistinguishable from each other so
answer =
- Define
by the rule
, for all integers
.
Is
one-to-one? Is
onto? Prove or give counterexamples.
Answer:
is one-to-one. Prove by showing that
.
Proof:
Let x and y be arbitrary in Z.
Assume
by substitution
by adding 5 to both sides
by dividing both sides by 4
by closing conditional world
by generalizing from GP
is not onto.
Disproof by Counter Example.
Let
by substitution
by algebra
But
is not in
so this is a valid counter example.
- Let
and
be functions, and
be defined by
for all real numbers
.
- If
and
are both one-to-one, is
also one-to-one?
Answer:
No. Counterexample:
Let
and
. Clearly they are 1-1. But
is clearly not 1-1.
- If
and
are both onto, is
also onto?
Answer:
No. Counterexample:
Let
and
. Clearly they are onto. But
is clearly not onto.
- If
and
are functions and
is onto,
must both
and
be onto? Prove or give a counterexample.
Answer: No.
is not necessary be onto. Counterexample:
Let
be defined by
and
be defined by
. Where
represents the absolute value of its argument. Then
defined by
is onto,
but
is not.
- Prove that
.
Answer:
- Let
. Suppose five integers are chosen
from
. Must there be two integers whose sum is 10? Why?
Answer: No. Counterexample:
- How many integers from 100 through 999 must you pick in order to be
sure that at least two of them have a digit in common?
(For example, 256 and 530 have the common digit 5.)
Answer: Two steps:
Step 1: Once you pick 10 integers, at least two of them have a digit in common.
Proof: Each integer you pick will ``occupy'' at least one digit from 1 to 9.
By pigeonhole principle the claim holds.
Step 2: Picking only 9 integers may not cause at least two of them to have a digit in common.
Proof: by example: pick
Therefore, answer = 10
In other words:
The domain is the set of numbers picked (we don't know the size of the domain).
The function is the value of the result of integer division when the selected value is divided by 100 (in other words only looking at the 100's place).
The codomain are the set of possible answers in that division which are onlly the values 1-9 since the number must be a 3-digit number so the size of the codomain is 9.
Since we want to be sure the function is not one-to-one, we must have the size
of the domain to be 10.
- Suppose
is a sequence of
integers none of
which is divisible by
. Show that at least one of the
differences
(for
) must be divisible by
.
Answer:
Since none of the
's is divisible by
,
. By
quotient remainder theorem,
. Since there
are
integers but
possible remainders, at least two of the integers
will have the same remainders when divided by
. Let them be
and
where
are integers. Then
is
divisible by
.
In other words:
The domain is the n integers in the series so the size of the domain is n.
The function is the remainder of integer division of that integer by n.
The co-domain are the values 1 through n-1 becasue since none of them are divisible by n, these are the only possible values. The size of the codomain is n-1.
Since the size of the domain is larger than the size of the co-domain and this is a total function, the pigeon hole principle can be applied and we know that this function is not one-to-one. This means that there must be at least two elements in the domain that map to a single element in the codomain. In other words, two of the integers in the domain have the same remainder. Since they have the same remainder, they are equivalent mod n and n divides there difference.
Kin-Keung Ma
2004-11-29
Web Accessibility