SorooshTaefi_Assinment#8

# SorooshTaefi_Assinment#8 - first we count the a’s and...

This preview shows pages 1–5. Sign up to view the full content.

Soroosh Taefi 8.2.1 a) q0 00 ⊢ Xq10 ⊢ X0 q1 8.2.2 c)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Soroosh Taefi 8.2.3 b) q0\$111 ⊢ \$q0111 \$1q011 \$11q01 ⊢ \$111q0 \$11q01 \$1q010 \$1q0 00 \$q0 100 \$q0 000 ⊢ \$q0 1000 state 0 1 Blank q0 ( , , q5 0 ) R ( , , ) q6 1 R ( , , ) qf B R q1 ( , , ) q2 0 R - - q2 ( , , ) q2 0 R ( , , ) q3 1 R ( , , ) q3 B R q3 ( , , ) q4 0 L ( , , ) q4 1 L ( , , ) q4 B L q4 - ( , , ) q6 1 R ( , , ) qf B R q5 ( , , ) q1 0 L ( , , ) q6 1 R ( , , ) qf B R q6 ( , , ) q0 0 R - ( , , ) qf B R 8.3.3)
Soroosh Taefi

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Soroosh Taefi 8.4.2 b) q0011 ⊢ 1q011 ⊢ 10q11 ⊢ 101q1 101⊡q2 ⊢ 1q001 ⊢ 11q01 ⊢ 110q1 110⊡q2 8.4.4) This machine would convert all the 0’s to 1. Also it will accept the strings starts with 0, otherwise it halts. 8.5.1 a) We will define a counter for each of the group of 0’s and 1’s. Then after counting each group we should check the counters. Then the counter of 0’s should be greater than counter of 1’s also greater than 1. 8.5.1 b) It is the same as 8.5.1 a.
Soroosh Taefi Optional 8.5.1 d (10 Points) We should define 3 counters as follow: counter1 -> a’s , counter2 -> b’s , counter3 -> c’s
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: first we count the a’s, and then after counting the b’s, we should compare them. If they were equal, then it will be accepted. If not we should count the c’s. After that we should compare the counter1 and counter3, if they were equal so it will be accepted, if not we should compare the counter2 and counter3, if they were equal then the string is accepted if not it won’t be accepted. 8.5.1 c (5 Points) We should define 3 counters, counter1 -> a’s , counter2 -> b’s , counter3 -> c’s first we should count the a’s and then we should count the b’s. If the counter1 and counter2 were equal, then the string accepted, if not we should counter c’s by the counter3. Then if counter1 and counter3 were equal then the string will be accepted and if not the string won’t be accepted. 8.4.3 (5 Points)...
View Full Document

{[ snackBarMessage ]}

### Page1 / 5

SorooshTaefi_Assinment#8 - first we count the a’s and...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online