CSCE 235

Final – Solution

 

May 6, 2009

 

Name:

 

NUID:

 

 

 

This examination consists of 6 questions and you have 120 minutes to complete the test.  You must show all steps (including any computations/explanations) that lead you to the answers.

 

1.         (25 points)  Let , , and  for .

            (a)  (5 points)  Compute the value of .

 

            Solution

 

           

 

(b)  (20 points)  Using the theorem on recursion relations given in class (see the last page), derive an explicit formula for . 

           

            Solution

 

So, in this case,  and .  The characteristic equation that we need to solve is ; that is: .  Solving for r gives us  and we have two characteristic roots:  and  .  So, we know that we can express  in terms of , or .  Now, we can solve for the constants  and .  .  We know also that .  Therefore,

Solving, we have and . Hence, the explicit formula is .

*      

 

2.         (25 points) 

(a)  (5 points)  For the pair of graphs shown, discover whether or not the graph on the left is a subgraph of the one on the right.  If it is not, explain why not.  If it is, label the vertices of the subgraph, then use the same symbols to label the corresponding vertices of the graph on the right.

     

            Solution

 

Yes, the graph on the left is a subgraph of the one on the right.  Here are the labels of the corresponding vertices:

     

(b)   (5 points)  For the following graph, determine whether or not the graph is bipartite.  If it is, give the bipartition sets.  If it is not, then explain why the graph is not bipartite.

 

            Solution

 

Yes, the graph is bipartite.  Here are the bipartition sets:  {A, C, F, H} the upper set, and {B, D, E, G} the lower set.  First, we color the vertices:

 

Now, we have the bipartite:

 

(c)    (5 points)  For the following graphs, if the graphs are not isomorphic, explain why not; if the graphs are isomorphic, relabel the graph on the right so as to show this isomorphism.

 

            Solution

 

 

 

 

No, the two graphs are not isomorphic.  The graph on the right has two rectangles: 1-3-5-7 and 3-4-5-6.  There is only one rectangle in the graph on the left: C-D-E-F.   

 

(d) (10 points) Which of the following has a Hamilton circuit?  Which of the following has an Euler circuit?  Which one has both circuits? Explain your answers. 

            (i)                  (ii)

           

            Solution

 

(i) Not Euler (some vertices have odd degree values), not Hamilton (it is a “Peterson graph”)

(ii) Not Euler (some vertices have odd degree values), Hamilton (I can visit all vertices).

*  

 

3.         (25 points)  Given the following tree:

 

 

(a)    (7 points) Give the list of names using pre-order traversal.

(b)    (7 points) Give the list of names using in-order traversal.

(c)    (7 points) Give the list of names using post-order traversal.

(d)   (2 points) This is an m-ary tree.  What is m?

(e)    (3 points)  What is the depth of the tree?

 

            Solution

 

(a)    pre-order traversal:  Chevrolet, Honda, Ford, Toyota, Hyundai, Ferrari, Volvo, Mercedes

(b)    in-order traversal:  Ford, Honda, Ferrari, Hyundai, Toyota, Volvo, Mercedes, Chevrolet

(c)    post-order traversal:  Ford, Ferrari, Hyundai, Volvo, Mercedes, Toyota, Honda, Chevrolet

(d)   m is 2.

(e)    Depth of the tree is 4.

 

*

 

4.         (25 points)  (Hint:  All proofs should be fewer than 15 steps):

            (a)        (12 points)  Give a formal proof for the following without using the contradiction approach:  If , , , then .

 

            Solution

 

                        1.                             Hypothesis

                        2.                           Hypothesis

                        3.                        Hypothesis

                        4.                              2, 3; disjunctive syllogism

                        5.                       1, 4; conjunction

                        6.            5; addition

                        7.             6; implication

 

            (b)        (13 points)  Give a formal proof for the following using the contradiction approach:  If , , , then .

 

            Solution

 

                        1.   Hypothesis

                        2.                   Hypothesis

                        3.                           Hypothesis

                        4.                negation of conclusion

                        5.                4; implication

                        6.                     5; De Morgan’s

                        7.                              6; simplification

                        8.                           7,2; modus ponens

                        9.                   8, 3; conjunction

                        10.                 9; De Morgan’s

                        11.                1, 10; modus tollens

                        12.                11; De Morgan’s

                        13.                         12; simplification

                        14.                   7, 14; conjunction

                        15. contradiction        

            *        

 

5.         (25 points)  Prove by induction that

 

 for all . 

           

            Solution

 

      First, we want to establish the basis.  For ,

 

 

            So, the basis is true by inspection.

 

Next, we want to establish the induction step.  We know that for some ,  holds (we just showed that it worked for ).  We want to show that for, given the above, the next case:  is also true:

 

.

 

This is now an algebraic exercise. 

 

.

 

Thus, we have shown that the induction step holds:  is true when  is true.


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

*  

 

 

6.         (25 points)  Suppose that there are 10 contestants, of which six are female, and four are male, in a lucky draw event.  Five winners are to be drawn for the first, second, third, fourth, and fifth prizes (one winner per prize).

 

(a)        (5 points) How many ways are there to draw the five winners?

 

            Solution

 

First, we choose five out of 10: .  Then, we have to order them, since each prize is different.  And that’s permutation of five objects: 5!.  Thus, the solution is: 5! = 252*120 = 30240.

 

(b)        (5 points) How many ways are there if the five winners are all female?

 

            Solution

 

Since there are six female contestants, then we choose five out of six:  and permute them accordingly.  Thus, we have 5! = 6*120 = 720.

 

(c)        (5 points) How many ways are there if there must be at least one male winner?

 

            Solution

 

Since we know the total number of ways is 30240 from (a), and number of ways with 0 male winners is 720 from (b), then the number of ways with at least one male winner must be 30240 – 720 = 29520.

 

(d)       (10 points) How many ways are there if the top three winners must be all female?

 

            Solution

 

First, let us figure out how many configurations there are for the five-winner order:

 

(1)   FFFMM

(2)   FFFMF

(3)   FFFFF

(4)   FFFFM

 

Case 1: There are  ways.

Case 2: There are  ways.

Case 3: There are 720 ways, from (b) above.

Case 4: This is similar to Case 2.  Thus, also 1440 ways.

 

Since these are mutually exclusive cases, we use the sum rule to add them up: 1440 + 1440 + 720 + 1440 = 5040 ways.

 

*

 


Logical Equivalences                                                Logical Implications

 

1.                                         double negation

16.                                   addition

2.a. 

2.b.                        commutative laws

2.c. 

17.                                   simplification

3.a. 

3.b.      associative laws

18.                              absurdity

4.a. 

4.b.  distributive laws

19.                        modus ponens

5.a.                                

5.b.                                 idempotent laws

20.                  modus tollens

6.a. 

6.b. 

6.c. 

6.d.                                 identity laws

21.                       disjunctive syllogism

7.a. 

7.b.                               negation laws

22. 

8.a. 

8.b. 

8.c. 

8.d.            DeMorgan laws

23.   transitivity of

9.              contrapositive

24. 

                        transitivity of  or hypothetical syllogism

10.a.                                               

10.b.             implication

25.a. 

25.b. 

25.c. 

11.a. 

11.b. 

26.a.          

26.b.                                                        

                                                         constructive dilemmas

12.a. 

12.b. 

27.a. 

27.b. 

                                                         destructive dilemmas

13.              equivalence

 

14.       exportation law

 

15.     reductio ad absurdum

 

 

 

 

 

 

 

 

 

Recurrence

 

Sequences that are defined by recursion appear frequently in mathematics and science, and there are several techniques for obtaining explicit formulas for them.  Here we have one theorem to solve recursion relations of the form

 

.

 

Here a and b are constants, and it is assumed that the two initial values  and  have been specified.  We will assume that a is not 0, and b is not 0.  It is convenient to ignore the specified values of  and  until later.  In view of the special cases we’ve examined, it is reasonable to hope that some solutions have the form  for some constant c.  This hope, if true, would force

 

 

Dividing by  would then give , or .  In other words, if  for all n, then r must be a solution of the quadratic equation , which is called the characteristic equation (or characteristic polynomial) of the recursion relation.

 

(a)     if the characteristic equation has distinct solutions (characteristic roots)  and , then

 

                                                                        (1)

 

for certain constants  and .  If  and  (the initial conditions) are specified, the constants can be determined by setting n = 0 and n = 1 in (1) and solving the two equations for  and .

 

(b)    if the characteristic equation has only one solution r then

 

                                                           (2)

 

for certain constants  and .  As in (a),  and  can be determined if  and  are specified.

 

The non-recursive equation is the solution.  Remember that the above theorem applies to only a specific case of recursion: linear and second order.  It is second order because it depends only on two immediately preceding terms.  It is linear because of the first power.