Download WUCT121: Discrete Mathematics Wollongong College Australia

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Numbers (TV series) wikipedia , lookup

List of important publications in mathematics wikipedia , lookup

History of mathematics wikipedia , lookup

Foundations of mathematics wikipedia , lookup

Ethnomathematics wikipedia , lookup

List of prime numbers wikipedia , lookup

Addition wikipedia , lookup

Discrete mathematics wikipedia , lookup

Four color theorem wikipedia , lookup

Elementary mathematics wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Transcript
WUCT121: Discrete Mathematics
Wollongong College Australia
Assignment 4 – Solutions, Autumn 2011
Question 1.
Draw all the non-isomorphic simple connected graphs on 4 vertices.
Question 2.
Label the vertices and edges of the following graphs in any convenient way and show whether or
not they are isomorphic:
Number of vertices: both 5; Number of edges: both 5; Degrees of corresponding vertices: all degree
2; Connectedness: Each is fully connected; Number of connected components: Both 1; Pairs of
connected vertices: All correspond; Number of loops: 0; Number of parallel edges: 0; Everything is
equal and so the graphs are isomorphic.
Alternately: label the vertices of each graph as vi and wi and edges as ei and fi such that ei=(vi,vi+1)
and fi=(wi,wi+1), and define maps φ:vi→wi, ψ:ei→fi such that ψ(ei)=(φ(vi), φ(vi+1))=(wi,wi+1)=fi.
Question 3.
The floor plan of a one-storey building is shown below. There are 4 rooms, A, B, C, D, and
doorways are indicated between rooms, and to the outside O. By converting the question to a
problem in graph theory, decide if it is possible to find a path that starts in room A and passes
through every doorway exactly once, ending in room C. Write down such a path if one exists.
WUCT121: Discrete Mathematics
Assignment 4, Autumn 2011
Submission Receipt
Student name: _______________________________________ Student number: ______________
Date submitted: ______________________________________ Tutor initials: ________________
Page 1 of 5
Define each room (and the outside) as a vertex and each doorway as an edge. Then δ(A)=5, δ(B)=4,
δ(C)=5, δ(D)=4, δ(O)=8. Then by Theorem 1.9.6 (Graph notes), since there is exactly one pair of
odd vertices, there exists an Eulerian path.
Question 4.
Apply Kruskal’s algorithm to the graph below to find a spanning tree for the graph that has
minimum weight.
Edge
(v5,v6)
(v1,v9)
(v1,v8)
(v5,v8)
(v2,v9)
(v4,v6)
(v1,v3)
Weight
1
2
2
2
3
3
5
Circuit?
No
No
No
No
No
No
No
Action
Add
Add
Add
Add
Add
Add
Add
Cumulative Weight
1
3
5
7
10
13
18
WUCT121: Discrete Mathematics
Assignment 4, Autumn 2011
Submission Receipt
Student name: _______________________________________ Student number: ______________
Date submitted: ______________________________________ Tutor initials: ________________
Page 2 of 5
(v2,v8)
(v6,v8)
(v2,v4)
(v7,v8)
(v3,v8)
5
5
7
8
10
Yes
Yes
Yes
No
Yes
Don’t add
Don’t add
Don’t add
Add
Don’t add
18
18
18
26
26
We can build a minimal weight spanning tree from this table. It will have weight 26.
Question 5.
(a) Use the quotient-remainder theorem to show that any integer n can be written in one of the
three forms n = 3q or n = 3q + 1 or n = 3q + 2 .
The Quotient–Remainder Theorem is as follows: If n and d > 0 are both integers, then there exist
unique integers q and r such that n = dq + r and 0≤r <d.
Now let d = 3: there exist unique integers q and r such that n = 3q + r and 0≤r<3, that is, n can be
written as one of the following forms: n=3q, n=3q+1, or n=3q+2, where q is some integer.
(b) By considering the three cases from (a), prove that the square of any integer has the form 3k
or 3k + 1 for some integer k.
Let n be an integer. There are three cases to consider:
If n=3q, then n2=(3q)2=9q2=3(3q2).
If n=3q+1, then n2=(3q+1)2=9q2+6q+1=3(3q2+2q)+1.
If n=3q+2, then n2=(3q+2)2=9q2+12q+4=3(3q2+4q+1)+1.
Question 6.
Use proof by contradiction to prove that for any integer n, n 2 − 2 is not divisible by 4. [Hint:
Consider the two cases where n is even and n is odd.]
Suppose n is even, then ∃ p ∈ Z such that n=2p. Then n2-2=4p2-2, which is not divisible by 4.
Suppose n is odd, then ∃ p ∈ Z such that n=2p+1. Then n2-2=4(p2+p)-1, which isn’t divisible by 4.
Question 7.
(a) By writing 174 and 835 as products of prime factors, find lcm(174, 835).
174 = 21 x 31 x 291 and 835 = 51 x 1671. Then lcm(174,835) = 21 x 31 x 51 x 291 x 1671 = 145290.
(b) Find the greatest common divisor of 3138 and 176. Hence, or otherwise, find integers m and n
such that gcd (3138, 176) = 3138m + 176n.
WUCT121: Discrete Mathematics
Assignment 4, Autumn 2011
Submission Receipt
Student name: _______________________________________ Student number: ______________
Date submitted: ______________________________________ Tutor initials: ________________
Page 3 of 5
Applying the Quotient-Remainder theorem we get the following:
3138 = 17 x (176) + 146
176 = 1 x (146) + 30
146 = 4 x (30) + 26
30 = 1 x (26) + 4
26 = 6 x (4) + 2
4 = 2 x (2) + 0
Therefore, gcd(3138,176)=2. Rewriting the equations with the remainders as subjects gives:
2 = 26 – 6 x (4)
(1)
4 = 30 – 1 x (26)
(2)
26 = 146 – 4 x (30)
(3)
30 = 176 – 1 x (146)
(4)
146 = 3138 – 17 x (176)
(5)
Substituting, we have:
2
= 26 – 6 x (4)
= 26 – 6 x (30 – 1 x (26))
= 26 – 6 x 30 + 6 x (26)
= 7 x (26) – 6 x (30)
= 7 x (146 – 4 x (30)) – 6 x (30)
= 7 x (146) – 28 x (30) – 6 x (30)
= 7 x (146) – 34 x (30)
= 7 x (146) – 34 x (176 – 1 x (146))
= 7 x (146) – 34 x (176) + 34 x (146)
= 41 x (146) – 34 x (176)
= 41 x (3138 – 17 x (176)) – 34 x (176)
= 41 x (3138) – 697 x (176) – 34 x (176)
= 41 x 3138 – 731 x (176).
Therefore, m = 41, and n = - 731.
from (1)
from (2)
from (3)
from (4)
from (5)
Question 8.
Use the Sieve of Eratosthenes to find all of the prime numbers between 300 and 400. [Working
must be shown as per Section 4.5 of your notes.]
The Sieve of Eratosthenes is a method of finding primes up to n as follows.
1. List all the primes up to √n 
2. Write down all integers from 1 to n, noting the listed primes
3. Delete all multiples of the listed primes.
4. The remaining values are the prime numbers up to n.
WUCT121: Discrete Mathematics
Assignment 4, Autumn 2011
Submission Receipt
Student name: _______________________________________ Student number: ______________
Date submitted: ______________________________________ Tutor initials: ________________
Page 4 of 5
The square root of 400 is 20 so we consider the prime numbers 2, 3, 5, 7, 11, 13, 17, and 19. We
must write down all of the numbers from 300 to 399, and eliminate all multiples of the listed primes
Eliminate all multiples of 2: 300, 302, 304, …, 398
Eliminate all remaining multiples of 3: 303, 309, 315, …, 399
Eliminate all remaining multiples of 5: 305, 325, 335, 355, 365, 385, 395
Eliminate all remaining multiples of 7: 301, 329, 343, 371
Eliminate all remaining multiples of 11: 319, 341
Eliminate all remaining multiples of 13: 377
Eliminate all remaining multiples of 17: 323, 391
Eliminate all remaining multiples of 19: 361
The remaining numbers 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389,
and 397, are prime numbers.
301
311
321
331
341
351
361
371
381
391
302
312
322
332
342
352
362
372
382
392
303
313
323
333
343
353
363
373
383
393
304
314
324
334
344
354
364
374
384
394
305
315
325
335
345
355
365
375
385
395
306
316
326
336
346
356
366
376
386
396
307
317
327
337
347
357
367
377
387
397
308
318
328
338
348
358
368
378
388
398
309
319
329
339
349
359
369
379
389
399
310
320
330
340
350
360
370
380
390
400
WUCT121: Discrete Mathematics
Assignment 4, Autumn 2011
Submission Receipt
Student name: _______________________________________ Student number: ______________
Date submitted: ______________________________________ Tutor initials: ________________
Page 5 of 5