CSCE 235

Examination 2 – Solution

 

April 1, 2009

 

1.         (25 points)  

(a)    (10 points)  Suppose that you are given two sets:

A = {Basketball, Football, Volleyball, Baseball} and B = {Red, White, Blue}

 

(i)      Define a function  such that it is onto, but not one-to-one.

(ii)    Define a function  such that it is one-to-one, but not onto.

(iii)  Define a function  such that it is one-to-one correspondence.

(iv)  Define a function  such that it is onto, but not one-to-one.

(v)    Define a function  such that it is one-to-one, but not onto.

(vi)  Define a function  such that it is one-to-one correspondence.

            *If such a function does not exist, please explain.

 

(i)     f(Basketball) = Red, f(Football) = White, f(Volleyball) = Blue, f(Baseball) = Blue.

(ii)    Does not exist since set A is larger than set B.

(iii)  Does not exist since the one-to-one property cannot be satisfied.

(iv)  Does not exist since set B is smaller than set A, and an element in B cannot be mapped to more than one element in A.

(v)    f(Red) = Basketball, f(White) = Football, f(Blue) = Volleyball.

(vi)  Does not exist since the onto property cannot be satisfied.

 

           

 

            (b)  (5 points)  Given functions mapping R to R (where R is the set of real numbers) as follows:  , , .  Find .

           

            .

 

           

 

            (c)  (10 points)  Let and define  by .  PROVE that  f  is one-to-one.  Find the inverse:.  (Assume that the .)

 

Suppose .  Then .  So, , or .  Hence .  Thus, f is one-to-one.  Given that , suppose that .  To find the inverse, we need to find .  So, we need to solve for .  As shown above, we know that .  Solving for , we have .  Thus, the inverse function is  where . 

           

 

2.         (25 points)  Prove by induction that  whenever n is a positive integer.

 

First, we show that the basis is true.  When ,

 

.

 

            We have shown that the basis step is true by inspection.

 

            Second, we show that the induction step is true.  Assume that  is true:

 

            Now, we need to show that  is true given that the above is true: 

 

.

     

            We know that .  From , we know that

 

      .

 

Thus we have shown that  is true.  Therefore, by the Principle of Mathematical Induction, we have shown that

 whenever n is a positive integer.

            *  

 

3.         (25 points) Assume that you are attending a big meeting with your clients.  Your clients sell rubber balls.  Each rubber ball can come in any combinations of four colors: blue (B), green (G), red (R), and purple (P).   For example, it is possible to have a rubber ball that is entirely blue, or with all four colors.  So, for example, B is the set of all rubber balls that has the color blue.   is the set of all rubber balls that has at least two colors: blue and green.  And so forth.  Here is a tally: 

 

, , , ,

, , , , ,

            , , ,

           

 

(a)     (5 points) Determine the number of balls that has all four colors.

 

That means we are looking for .  To do this, we use the Principle of Inclusion-Exclusion:

+

Plugging the numbers:

100 = 50 + 30 + 40 +20 – 10 – 8 – 8 – 10 – 10 – 8 + 5 + 3 + 2 + 5 -

Rearranging the equation, we have  = 1.  So, there is only ball that has all four colors.

                 

*

 

(a)                (10 points) What is the number of balls that has exactly two colors: blue and green?

 

Basically, this is . We can simplify that to be:  = .  We know .  For , we can assume that  = X, and = Y, and then basically we have .  Once again, we can use the Principle of Inclusion-Exclusion:  = .   Replacing the substation back, then we have:   =  + -= 5 + 3 – 1 = 7.

 

Thus, the answer is = = 10 – 7 = 3.

 

*

 

            (c)  (10 points)  Now, given the set of rubber balls, they need to be packaged into 6 boxes.  Each box must have at least five rubber balls.  Assume that there is only ONE box that has the largest number of rubber balls and we call this box BigBox.  What is the range of the number of balls that BigBox will have? (Requirement: Must use the Pigeon-Hole Principle.) (Think: think about the minimum and maximum number of balls that BigBox can have)

 

Using the Pigeon-Hole Principle, there are n = 100 objects (rubber balls) and m = 6 boxes, and one of the boxes must have at least objects, which is .  Thus, BigBox must have at least 17 balls or otherwise it would not be BigBox. 

 

Since each box must have at least five rubber balls, that means in the “best case”, there are 100 – 5*5 = 100 – 25 = 75 balls left to be packaged into BigBox. 

 

Thus, the range is between 17 and 75.

 

*

 

5.         (25 points)  Suppose you are a software development manager at a company and there are seventeen software engineers whom you manage. 

 

(a)    (6 points) How many ways are there to divide the engineers into 3 groups of four and 1 group of five? 

 

First, we select five to be in that special group of five: .  Then we proceed to select the others: .  Thus, the total number of ways is: *= 6188*495*70*1=214,414,200.  Note that order is not important.

*

 

(b)   (6 points) Suppose that there are 8 female and 9 male software engineers in the group.  How many ways are there to come up with a group assignment of two all-female groups and two all-male groups?

 

For the two female groups, we have  to choose four for the first group, and then  to choose the second group.  For the two male groups, similarly, we have  and then .  Altogether, then we have = 70*1*126*1 = 8820 ways.

*

 

(c)    (7 points) Suppose that Tom, Mary, John, and Beth are among the 17 software engineers but they must be the leader of their own group, how many ways are there now to divide the engineers into 3 groups of four and 1 group of five?

 

First, let’s take these four people out of the mix.  Then we have *= 715*84*20*1 = 1,201,200 ways to divide the remaining 13 engineers into three groups of three and 1 group of four.

 

Now, we need to take care of the four leaders.  Assume that the four groups we have built so far are G1, G2, G3, and G4.  Then the number of ways to put the four leaders into the four groups is simply 4!.  And thus, we have 4!* 1,201,200 = 28,828,800.

 

*

 

(d)   (6 points) Suppose that you want Tom, Mary, John, and Beth to be in one group. How many ways are there now to divide the 17 engineers into 3 groups of four and 1 group of five?

 

There are two scenarios.  First, Tom, Mary, John, and Beth are in one group and nobody else is in that group.  This is very similar to (a).  Now, we have only three groups to consider and only 13 engineers to consider:  = 715*126*1=90,090.

 

Second, Tom, Mary, John, and Beth are in one group and the group has a fifth person.  So now, we need to choose one person out of the remaining 13 to join that group: . Then, we proceed with the other three groups: .  Thus, there are *= 13*495*70*1 = 460,450.

 

Adding the two scenarios together yields 90,090 + 460,450 = 540,540.

 

 

*