Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Problem of the Day: Describe using set descriptor notation the complements of (a) { , a, aa, aaa} over ∑ = {a} (b) { , a, aa, aaa} over ∑ = {a,b} (c)

Similar presentations


Presentation on theme: "1 Problem of the Day: Describe using set descriptor notation the complements of (a) { , a, aa, aaa} over ∑ = {a} (b) { , a, aa, aaa} over ∑ = {a,b} (c)"— Presentation transcript:

1 1 Problem of the Day: Describe using set descriptor notation the complements of (a) { , a, aa, aaa} over ∑ = {a} (b) { , a, aa, aaa} over ∑ = {a,b} (c) {0,1}* {0010} {0,1}* over ∑={0,1} (d) {001} {0,1}* over ∑={0,1} (e) {0,1}* {1101} over ∑={0,1}

2 2 Announcements Tutorial #2 has been added to connex (it was on the class web pages before). You can attend both sections if you need extra help. Assignment #1 is due at the beginning of class this Fri. Sept. 24. Hand it in on paper (not electronically). Make sure you sign the class attendance sheet each class. If you want more time for our proof of the day, the notes are usually posted some time the night before or come to class early.

3 3 Introduction to Graph Theory Introduction to graph theory (review of CSC 225). Many of the hard problems (problems for which we do not have a polynomial time algorithm) studied at the end of the class are questions about graphs.

4 4 An undirected graph G consists of a set V of vertices and a set E of edges where each edge in E is associated with an unordered pair of vertices from V. The degree of a vertex v is the number of edges incident to v. If (u, v) is in E then u and v are adjacent. A simple graph has no loops or multiple edges. Exercise: prove by induction that a simple graph G on n vertices has at most n(n-1)/2 edges.

5 5 Internet taken from: http://www.netdimes. org/asmap.png

6 6 Travelling Salesman From: Ehsan Moeinzadeh Guildford, Surrey, United Kingdom

7 7 Graphs representing chemical molecules

8 8

9 9 A cycle of a graph is an alternating sequence of vertices and edges of the form v 0, (v 0, v 1 ), v 1, (v 1, v 2 ), v 2, (v 2, v 3 ), …,v k-1, (v k-1, v k ), v k where except for v 0 = v k the vertices are distinct. Exercise: define path, define connected. A tree is a connected graph with no cycles. A subgraph H of a graph G is a graph with V(H)  V(H) and E(H)  E(G). H is spanning if V(H) = V(G). Spanning tree- spanning subgraph which is a tree.

10 10 Strange Algorithms Input: a graph G Question: does G have a spanning tree? This can be answered by computing a determinant of a matrix and checking to see if it is zero or not. Don’t make assumptions about what my algorithms for Hamilton Path/Hamilton cycle are doing! Treat them as a black box.

11 11 Fullerenes Correspond to 3-regular planar graphs. All faces are size 5 or 6. Euler’s formula: exactly 12 pentagons.

12 Nobel Prize in Chemistry 1996 In 1996, the Nobel Prize in Chemistry was awarded jointly to Robert Curl, Harold Kroto and Richard Smalley for their discovery of fullerenes. Prof Sir Harold W. Kroto Prof Robert F. Curl Jr Prof Richard E. Smalley Photo: P. S. HowellPhoto: Prudence CummingsPhoto: P. S. Howell, Rice

13 13 Hamilton Cycles A cycle which includes all the vertices of a graph. Conjecture: Every fullerene has at least one Hamilton cycle.

14 14 Min Number of Hamilton Cycles

15 15 Conjecture For all fullerenes except isomer 38:2, every edge is in at least one Hamilton cycle Isomer 38:2

16 16 Conjecture For all isomers except 38:2 and 40:8, no edge is in every Hamilton cycle. e Isomer 40:8

17 17 Incorrect Conjecture Every fullerene has some Hamilton cycle with no 6-cycles like this: Isomer 74:5689

18 18 Regular Languages http://eloquentjavascript.net/img/xkcd_regular_expressions.png

19 19 Operations on Languages: 1. Complement of L defined over Σ = = { w  Σ * : w is not in L } 2. Concatenation of Languages L 1 ۰ L 2 = L 1 L 2 = {w= x ۰ y for some x  L 1 and y  L 2 } 3. Kleene star of L, L * = { w= w 1 w 2 w 3 … w k for some k ≥ 0 and w 1, w 2, w 3, …,w k are all in L} 4. L + = L ۰ L * (Concatenate together one or more strings from L.)

20 20 Σ * = set of all strings over alphabet Σ Language over Σ – any subset of Σ * Examples: Σ = {0, 1} L 1 = { w  Σ * : w has an even number of 0’s} L 2 = { w  Σ * : w is the binary representation of a prime number with no leading zeroes} L 3 = Σ * L 4 = { } = Φ L 5 = { ε }

21 21 L 2 = {w  {0,1}* : w is the binary representation of a prime with no leading zeroes} The complement is: {w  {0,1}* : w is the binary representation of a number which is not prime which has no leading 0’s or w starts with 0} Note: 1 is not prime or composite. The string 1 is in the complement since it is not in L.

22 22 12 01 33 11 11 11 12 01 11 11 13 13 = = Matrix multiplication: Concatenation: ab ۰ bb = abbb bb ۰ ab = bbab

23 23 Regular Languages over Alphabet Σ: [Basis] 1. Φ and {σ} for each σ  Σ are regular languages. [Inductive step] If L 1 and L 2 are regular languages, then so are: 2. L 1 ۰ L 2, 3. L 1 ⋃ L 2, and 4. L 1 *.

24 24 Regular expressions over Σ: [Basis] 1. Φ and σ for each σ  Σ are regular expressions. [Inductive step] If α and β are regular expressions, then so are: 2. ( αβ) 3. (α ⋃ β) and 4. α * Note: Regular expressions are strings over Σ ⋃ { (, ), Φ, ⋃, * } for some alphabet Σ.

25 25 Precedence of Operators Exponents Multiplication Addition Kleene star Concatenation Union highest ⇩ lowest


Download ppt "1 Problem of the Day: Describe using set descriptor notation the complements of (a) { , a, aa, aaa} over ∑ = {a} (b) { , a, aa, aaa} over ∑ = {a,b} (c)"

Similar presentations


Ads by Google