CS3102 Theory of Computation
Warm up: This automaton computes infinite AND: π΅ππΈ = π¦ β 0,1 β π¦ has no 0s} Show how to compute infinite NAND: ππ΅ππΈ = {π¦ β 0,1 β|π¦ has a 0}
start
0,1 1
Some 0s No 0s
1
CS3102 Theory of Computation 0,1 Some 0s 0 0 start Warm up: 1 - - PowerPoint PPT Presentation
CS3102 Theory of Computation 0,1 Some 0s 0 0 start Warm up: 1 1 No 0s This automaton computes infinite AND: = 0,1 has no 0s} Show how to compute infinite NAND: = { 0,1 | has
start
0,1 1
Some 0s No 0s
1
2 start
No 0s
0,1 1
Some 0s
1
β π = π‘π’ππ π’, ππ0π‘, ππππ0π‘ β π0 = π‘π’ππ π’ β πΊ = {π‘π’ππ π’, ππ0π‘} β π defined as the arrows
β π , π0, π donβt change β πΊ = π β πΊ
3 start
No 0s
0,1 1
Some 0s
1
4
5
6
7
8
Input Output 000 001 010 1 011 100 1 101 1 110 111
9
10
Input Output 000 001 010 1 011 100 1 101 1 110 111 ββ 000 1 00 001 010 011 101 100 110 111 01 10 10 1 1 1 1 1 trash 0,1 0,1 0,1
11
Name Decision Problem Function Language Regex Does this string match this pattern? π π = α0 the string matches 1 the string doesnβ²t π β Ξ£β π matches the pattern}
β Matches just the string of length 0 β Notation: π or ββ
β Matches a specific string of length 1 β Example: the regex π will match just the string π
β Matches strings that match at least one of the two parts β Example: the regex π|π will match π and π
β Matches strings that can be dividing into 2 parts to match the things concatenated β Example: the regex π π π will match the strings ππ and ππ
β Matches strings that are 0 or more copies of the thing starred β Example: π π πβ will match π, π, or either followed by any number of πβs
12
Note: The compents here are the minimal necessary. In practice, regexes have other components as well, those are just βsyntactic sugarβ.
13
14
15
16
17
18
19
20
β Matches just the string of length 0 β Notation: π or ββ
β Matches a specific string of length 1 β Example: the regex π will match just the string π
β Matches strings that match at least one of the two parts β Example: the regex π|π will match π and π
β Matches strings that can be dividing into 2 parts to match the things concatenated β Example: the regex π π π will match the strings ππ and ππ
β Matches strings that are 0 or more copies of the thing starred β Example: π π πβ will match π, π, or either followed by any number of πβs
21
22
23
24