CSCI 190 Final Part I Solutions

CSCI 190 Final Part I 6-8-16
1) (6 points) Prove that
2 is an irrational number.
Solution: see the Exam I study guide
2) Define a relationship R on
R 2 as follows: (a, b) R(c, d ) iff there is a positive constant k such
that (a, b)  k (c, d )
a) (6 points) Show that R is an equivalence relation.
Solution:
i)
Reflexive: ( a, b) R ( a, b) since (a, b)  1  ( a, b)
ii)
Symmetric: Suppose ( a, b) R (c, d ) . Then (a, b)  k  (c, d ) for some positive constant
k. Since k is not 0, divide by k to get (c, d ) 
1
1
 (a, b) and is positive. Therefore
k
k
( c, d ) R ( a , b )
iii)
Transitive: Suppose ( a, b) R (c, d ) and (c, d ) R(e, f ) . Then there exist
k1 , k2  0 with
(a, b)  k1 (c, d ) and (c, d )  k2 (e, f ) . Then (a, b)  (k1k2 )(e, f ) and k1k2  0 . Therefore
(a, b) R(e, f )
b) (2 points) Describe the equivalence class of (1,2) geometrically.
Solution: (1, 2) R( x, y ) iff (1, 2)  k ( x, y ) for some k iff ( x, y )  k (1, 2) for some k. i.e. [(1, 2)] is
all positive multiples of (1, 2) such as (2, 4), (3, 6), (0.5,1).... These points represents the
points on the line y  2 x, x  0
3) (4 points each)
a) Suppose a box contains 100 red balls, 120 green balls, and 100 brown balls. Construct a
generating function to find the number of ways to select 10 balls if either 2 or 3 red balls
must be selected and at least 2 brown balls and at least two green balls must be
selected.
Solution:
G( x)  ( x 2  x3 )( x 2  x3 
Recall the expansion
) 2  x 2 (1  x)( x 4 )(1  x  x 2 
) 2  x 6 (1  x)
1
1
 ( x6  x7 )
2
(1  x)
(1  x) 2


 n  k  1 k
 2  k  1  k   k  1 k
1
1
.
Thus

x




x   
x


(1  x)n k 0  k
(1  x)2 k 0  k
k 
k 0 



 k  1 k   k  1 k  6   k  1 k  7
10
( x 6  x 7 ) 
x   
x   
x . To find the coefficient of x , use k  4 from
k 
k 
k 
k 0 
k 0 
k 0 
5   4
the first expression and use k  3 from the second expression.       5  4  9
 4 3 
Thus
b) A group contains 7 men and 7 women. How many ways are there to arrange these
people in a row if the men and women alternate?
Solution: Men and women can alternate in two ways: first person could be a man or a woman.
 2(7!)(7!)
4)
(4 points each)
a)
List all nonisomprphic unrooted trees of order 4.
b) Explain briefly why or give a formal proof that every edge of a tree is a cutedge.
Solution: A tree is a connected graph with no circuits. If an edge incident the vertices v and w is
not a cutedge, then there is another path from v to w. This would create a circuit, a contradiction.
c) Determine if the graphs given by the adjacency matrices below are isomorphic. If they
are isomorphic, construct an isomorphism. If not, then briefly state the reasons.
0 1 1 
0 1 0 


G1  1 0 0 , G2  1 0 1 
1 0 0
0 1 0
They are isomorphic. Let
v1 , v2 , v3 be the vertices in G1 and w1 , w2 , w3 be vertices in G2
Consider the function that sends
v1  w2 , v2  w1 , v3  w3
This function preserves adjacency since
(v1 , v2 )  (v2 , v1 ),(v1 , v3 )  (v2 , v3 ),
5) (4 points each ) Use a) Kruskal’s algorithm b) a) Prim’s algorithm to find a spanning tree of
minimum weight. Caution: there may be more rows in the table than the number of edges
required to construct a spanning tree. Two copies of the same weighted graph are provided
for your convenience. The vertices are labeled A, B, C, D, …H, and the numbers on the
edges are the weights.
Solutions: (They are many different minimum spanning trees are possible, but the final weight
must be the same)
Step
1
2
3
4
5
6
7
8
9
Prim
Edge
CE
EG
GH
DH
EF
ED
AB
Weight
5
7
5
10
10
20
25
Kruskal
Edge
CE
GH
EG
Weight
5
5
7
6) (4 points each)
a) Solve
x5  2(mod13)
Solution:
Since the exponent is smaller than 12, so it cannot reduced. Find the inverse of 5 mod 12 (using
 (13) ).
12  5  2  2
5  2  2 1
 1  5  2  2  5  2(12  5  2)  5(5)  12( 2)
Thus
5  (5)  12(2)  1  5(5)  1(mod12)  51  5 .
x5  2(mod13)  ( x5 )5  25 (mod13)  x  32(mod13)  x  6(mod13)
b) Show that if
(2n  1) is prime, then the number of the form 2n 1 (2n  1) is a perfect number.
Solution: See the study guide on perfect numbers.
c) Use Chinese Remainder Theorem to solve the simultaneous congruence
x  2(mod 3), x  3(mod 5) x  1(mod 7)
Solution: )
5(7)  35 . First solve 35 x  1(mod 3) . Since 35  2(mod 3) , 35 x  1(mod 3) becomes
2 x  1(mod 3) . Using trial and error, we get x  2(mod 3) . Next 2(7)  14 , so solve 14 x  1(mod 5) .
Since
14  1(mod 5) , 14 x  1(mod 5) becomes  x  1(mod 5) . Multiply both side by 1 , we get
x  1(mod 5) . Finally, since 3(5)  15 , solve 15 x  1(mod 7) . Since 15  1(mod 7) , 15 x  1(mod 7)
becomes
x  1(mod 7) . This equation is already solved!
Let
x  35(2)(2)  14(1)(3)  15(1)(1)  113 . Then 113  2(mod 3),113  3(mod 5),113  1(mod 7),