The following solutions make use of information found on pages 344 - 354 of the textbook.
Fill in the blanks to complete the following sentences.
You should attempt all these exercises yourself, using the textbook as an aid. Once you have attempted each question, check your answers by following the appropriate links. If you are stuck on a question, choose the link that gives you a hint and then try the question again.
1. Let f be the function defined by the arrow diagram below:
a) Write down the domain and co-domain of f.
b) Find f(1), f(2) and f(3).
c) What is the range of f?
d) Find the inverse images of a, b and c.
2. Which of the following define functions? Explain your answer.
a) | b) |
3.a) Define functions f : RR and g : R
R, where
f(x) = x for all x
R
and g(x) =
for all x
R. Is f = g? Explain your answer.
b) Define functions f : RR and g : R
R, where
f(x) = x for all x
R
and g(x) =
for all x
R. Is f = g? Explain
your answer.
4. Write the sequence -4, 9, -16, 25, ... as a function.
5. Read Example 7.1.11 on pages 351 - 352 of the textbook. Then use the Hamming distance function to calculate H(1100101, 0010111).
6. A binary operation on a set X is a special kind of function from X
× X to X. One example of a binary operation is addition on the set Z.
Let f: Z × Z Z be the function of addition
on the integers.
a) Evaluate f((3,2)).
b) Find an element of Z × Z with an image of -1.
7. Suppose you are told that a function f: Q Z is to
be defined by the formula f( m/n) = n for all integers m and n where
n
0. Is f well-defined?
Justify your answer.
The following solutions make use of information found on pages 357 - 364 of the textbook.
Fill in the blanks to complete the following sentences.
You should attempt all these exercises yourself, using the textbook as an aid. Once you have attempted each question, check your answers by following the appropriate links. If you are stuck on a question, choose the link that gives you a hint and then try the question again.
1. A vending machine dispenses jaw-breakers that cost 20¢ each. The machine accepts
5¢, 10¢ and 20¢ pieces only and does not give change. As soon as the amount
deposited equals or exceeds 20¢, the machine releases a jaw-breaker. The next coin
deposited starts (from zero) the process over again.
Draw a transition diagram for this finite-state automaton.
2. Consider the finite-state automaton A defined by the transition diagram below:
a) What are the states of A?
b) What are the input symbols of A?
c) What is the initial state of A?
d) What are the accepting states of A?
e) Find N(t1, 1) and N(t3, 0).
f) Create the annotated next-state table for A.
3. Consider the finite-state automaton A defined by the following next-state table:
a) What are the states of A?
b) What are the input symbols of A?
c) What is the initial state of A?
d) What are the accepting states of A?
e) Find N(X, b) and N(Y, a).
f) Draw the transition diagram for A.
4. Refer back to Question 2.
a) To which states would the automaton go for each of the following strings of input
symbols?
i) 01 ii) 0010 iii) 11000 iv) 111
b) Which of the strings from part a) send the automaton to an accepting state?
c) What is the language accepted by this automaton?
5. Refer again to Question 2. Find N*(t2, 00100).
The following solutions make use of information found on pages 369 - 384 of the textbook.
Fill in the blanks to complete the following sentences.
You should attempt all these exercises yourself, using the textbook as an aid. Once you have attempted each question, check your answers by following the appropriate links. If you are stuck on a question, choose the link that gives you a hint and then try the question again.
1. Which of the following functions are one-to-one? Which of them are onto?
2. Define the functions f: RR and g: R
R
by f(x) = | x | + 1 and g(x) = 2x3-1, for all x in R.
Are these functions one-to-one? In each case either prove that the function is one-to-one
or give a counterexample to show that it is not one-to-one.
3. Searching through long lists is a slow process. One way to speed up the search is to divide the long list into a number of smaller lists. If we have some method of quickly identifying in which of the smaller lists a particular item will appear, then we need only search through the smaller list to find the item.
Suppose we wish to maintain the customer records for a large company and begin by assigning each customer a unique 7-digit account number. This 7-digit number will be used as input to a function H which will determine the sublist to be searched to find the account details. The company has 30,000 customers and we are going to partition the list of accounts into 100 sublists of approximately 300 items each. We define a hash function which maps each 7-digit account number, say n, to an element x in the set {0, 1, 2, 3, ..., 99}, such that H(n) = x, where n mod 100 = x.
a) Calculate to which sublists each of the following account numbers would be
allocated.
i) 2473871 ii) 3569842 iii)
9085000 iv) 8574642
b) Is the function H one-to-one? Explain.
4. Define the functions F: RR+ È
{0} and G: Z
Z by F(x) = x2 for all x
in R and G(x) = x2 for all x in Z. Are
these functions onto? In each case either prove that the function is onto or give a
counterexample to show that it is not onto.
5. Define the function F: RR by F(x) = 2x + 4 for
all x in R. Show that F is onto.
6. Is the function f: XY a one-to-one correspondence, where X = {0, 1, 2, 3} and Y
= {0, 1, 4, 9} and f(x) = x2 for all x in X? Justify your answer.
7. Given the functions f and g illustrated in the following arrow diagrams, find (if they exist) f-1 and g-1. If they do exist, draw their arrow diagram.
8. Find (if it exists) the inverse of the function g: RR
where g(x) = 2x + 5 for all x in R.
The following solutions make use of information found on pages 387 - 399 of the textbook.
Fill in the blanks to complete the following sentences.
You should attempt all these exercises yourself, using the textbook as an aid. Once you have attempted each question, check your answers by following the appropriate links. If you are stuck on a question, choose the link that gives you a hint and then try the question again.
1. How many students must be in a class to guarantee that at least two students receive the same mark on the final exam which is graded on a scale of 0 to 100, (with no half marks allowed)?
2. There are 680 people on a list. Must there be at least two people on the list with the same first and last initials? Justify your answer.
3. The Prime Minister is packing to go to an important meeting in Asia, but there is a sudden black-out and so he is fumbling around in the dark. He is reaching into his wardrobe to find a tie to wear at the meeting. He has 12 ties, five ties that he likes and seven that he doesn't like. How many ties must he pull out of his wardrobe to be guaranteed of having at least one tie that he likes?
4. Show that in a group of 25 people, at least three must have the same astrological star sign.
5. Assume that in a group of six people, each pair of individuals are either friends or enemies. Show that there are either three mutual friends or three mutual enemies in the group.
The following solutions make use of information found on pages 401 - 410 of the textbook.
Fill in the blanks to complete the following sentences.
You should attempt all these exercises yourself, using the textbook as an aid. Once you have attempted each question, check your answers by following the appropriate links. If you are stuck on a question, choose the link that gives you a hint and then try the question again.
1. Let f: RR be defined by f(x) = x3
for all x
R
and let g: R
R be defined by g(x) = 2x - x2
for all x
R.
a) Find (f o g)(x) and (g o f)(x).
b) Is g o f = f o g?
2. Let X = {a, b, c}, Y' = {1, 2, 3}, Y = {1, 2, 3, 4} and Z = {w, x, y, z}. Define
the functions f: XY'
and g: Y
Z by the
diagram below.
a) Draw the arrow diagram for g o f.
b) What is the range of g o f?
3. Suppose that f: ZZ is a function where f (x) = x + 1 for all
x
Z. Let iZ be the identity function.
a) Find ( f o iZ )(x) and ( iZ o f )(x).
b) If g: XX
is any function, what can you say about the functions g o iX
and iX o g?
4. Let f and g be functions defined by the arrow diagrams below.
a) Draw the arrow diagram representing g o f.
b) f and g are both one-to-one. Is g o f one-to-one?
5. Let F and G be functions defined by the arrow diagrams below.
a) Draw the arrow diagram representing F o G.
b) F and G are both onto. Is F o G onto?
The following solutions make use of information found on pages 411 - 416 of the textbook.
Fill in the blanks to complete the following sentences.
You should attempt all these exercises yourself, using the textbook as an aid. Once you have attempted each question, check your answers by following the appropriate links. If you are stuck on a question, choose the link that gives you a hint and then try the question again.
1. Show that the set of all odd integers is countable.
2. Show that there is no one-to-one correspondence between a set X and its power set P(X).
3. Verify that the set P(Z+) is uncountable.