SorooshTaefi_Assinment#8

SorooshTaefi_Assinment#8 - first we count the as, and then...

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

View Full Document Right Arrow Icon
Soroosh Taefi 8.2.1 a) q0 00 ⊢ Xq10 ⊢ X0 q1 8.2.2 c)
Background image of page 1

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

View Full DocumentRight Arrow Icon
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)
Background image of page 2
Soroosh Taefi
Background image of page 3

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

View Full DocumentRight Arrow Icon
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.
Background image of page 4
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
Background image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: first we count the as, and then after counting the bs, we should compare them. If they were equal, then it will be accepted. If not we should count the cs. 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 wont be accepted. 8.5.1 c (5 Points) We should define 3 counters, counter1 -> as , counter2 -> bs , counter3 -> cs first we should count the as and then we should count the bs. If the counter1 and counter2 were equal, then the string accepted, if not we should counter cs by the counter3. Then if counter1 and counter3 were equal then the string will be accepted and if not the string wont be accepted. 8.4.3 (5 Points)...
View Full Document

Page1 / 5

SorooshTaefi_Assinment#8 - first we count the as, and then...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online