SlideShare a Scribd company logo
1 of 2
Download to read offline
MTH 401: Theory of Computation August 17, 2016
Department of Mathematics and Statistics Time: 10 minutes
Indian Institute of Technology - Kanpur Maximum Score: 10
Quiz
Name
Roll Number
Let Σ = {0, 1}. Draw a deterministic finite state machine, M = (Q, Σ, δ, q0, F) that accepts
the language containing binary strings that are not divisible by 3. In other words, draw M
with
L(M) = L = {w ∈ Σ∗
: w = (n)2 for some n ∈ N such that 3 | n}.
Note that (n)2 denotes the binary representation of n and the symbol k | n denotes that k
does not divide n. Justify your answer. [10]
Solution: We need three states to keep track of the remainder as we read through the
symbols of the binary number. Thus,
Q = {0, 1, 2}
where the label i indicate that the current remainder is i. The start state, obviously, is 0
and the set of final states is clearly F = {1, 2}.
The first few step in the evolution of the remainder is shown in the figure below:
More generally, to understand the transitions, let w be a string of length k such that w = (n)2.
Then, clearly,
n =
k
i=1
w(i)2k−i
.
2
(for example, if w = 101, then (1)22
+(0)21
+(1)20
= 5.) Therefore, the string w0 correspond
to
k
i=1
w(i)2k+1−i
+ (0)20
= 2
k
i=1
w(i)2k−i
= 2n
and for the string w1, we have
k
i=1
w(i)2k+1−i
+ (1)20
= 2
k
i=1
w(i)2k−i
+ 1 = 2n + 1.
Now, if w = (n)2 is divisible by 3, i.e., n = 3m for some m, then 2n = 2(3m) = 3(3m) is still
divisible by 3 whereas 2n + 1 = 2(3m) + 1 = 3(2m) + 1 leaves remainder 1 when divided by
3. Thus,
δ(0, 0) = 0 and δ(0, 1) = 1
Similarly, if n = 3m + 1 for some m, then 2n = 2(3m + 1) = 3(2m) + 2, whereas 2n + 1 =
2(3m + 1) + 1 = 3(m + 1). Thus,
δ(1, 0) = 2 and δ(1, 1) = 0
Finally, for an n of the form n = 3m + 2 for some m, 2n = 2(3m + 2) = 3(2m + 1) + 1 and
2n + 1 = 2(3m + 2) + 1 = 3(2m + 1) + 2 and hence,
δ(2, 0) = 1 and δ(2, 1) = 2.
Thus, the finite state machine, M can be drawn as shown in the figure below:

More Related Content

What's hot

2/27/12 Special Factoring - Sum & Difference of Two Cubes
2/27/12 Special Factoring - Sum & Difference of Two Cubes2/27/12 Special Factoring - Sum & Difference of Two Cubes
2/27/12 Special Factoring - Sum & Difference of Two Cubes
jennoga08
 
Binomial Theorem
Binomial TheoremBinomial Theorem
Binomial Theorem
itutor
 
05 perfect square, difference of two squares
05   perfect square, difference of two squares05   perfect square, difference of two squares
05 perfect square, difference of two squares
majapamaya
 
1475050 634780970474440000
1475050 6347809704744400001475050 634780970474440000
1475050 634780970474440000
Aditee Chakurkar
 

What's hot (17)

Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
Constraint Satisfaction Problem (CSP) : Cryptarithmetic, Graph Coloring, 4- Q...
 
The binomial expansion
The binomial expansionThe binomial expansion
The binomial expansion
 
2/27/12 Special Factoring - Sum & Difference of Two Cubes
2/27/12 Special Factoring - Sum & Difference of Two Cubes2/27/12 Special Factoring - Sum & Difference of Two Cubes
2/27/12 Special Factoring - Sum & Difference of Two Cubes
 
Q1 week 1 (common monomial,sum & diffrence of two cubes,difference of tw...
Q1  week 1 (common monomial,sum & diffrence of two cubes,difference of tw...Q1  week 1 (common monomial,sum & diffrence of two cubes,difference of tw...
Q1 week 1 (common monomial,sum & diffrence of two cubes,difference of tw...
 
Binomial Theorem
Binomial TheoremBinomial Theorem
Binomial Theorem
 
Bresenham's line drawing algorithm
Bresenham's line drawing algorithmBresenham's line drawing algorithm
Bresenham's line drawing algorithm
 
Bresenhams
BresenhamsBresenhams
Bresenhams
 
Binomial Theorem 1
Binomial Theorem 1Binomial Theorem 1
Binomial Theorem 1
 
Factoring Sum and Difference of Two Cubes
Factoring Sum and Difference of Two CubesFactoring Sum and Difference of Two Cubes
Factoring Sum and Difference of Two Cubes
 
09 p.t (straight line + circle) solution
09 p.t (straight line + circle) solution09 p.t (straight line + circle) solution
09 p.t (straight line + circle) solution
 
Aplikasi Bilangan Kompleks - Analisis Sinyal [PAPER]
Aplikasi Bilangan Kompleks - Analisis Sinyal [PAPER]Aplikasi Bilangan Kompleks - Analisis Sinyal [PAPER]
Aplikasi Bilangan Kompleks - Analisis Sinyal [PAPER]
 
05 perfect square, difference of two squares
05   perfect square, difference of two squares05   perfect square, difference of two squares
05 perfect square, difference of two squares
 
A study on number theory and its applications
A study on number theory and its applicationsA study on number theory and its applications
A study on number theory and its applications
 
Binomial
BinomialBinomial
Binomial
 
Algebra s
Algebra sAlgebra s
Algebra s
 
1475050 634780970474440000
1475050 6347809704744400001475050 634780970474440000
1475050 634780970474440000
 
Binomial theorem
Binomial theoremBinomial theorem
Binomial theorem
 

Similar to Quiz1 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur

Prin digcommselectedsoln
Prin digcommselectedsolnPrin digcommselectedsoln
Prin digcommselectedsoln
Ahmed Alshomi
 
Mock cat solutions paper no 1
Mock cat solutions paper no 1Mock cat solutions paper no 1
Mock cat solutions paper no 1
Vandan Kashyap
 
Recurrent problems: TOH, Pizza Cutting and Josephus Problems
Recurrent problems: TOH, Pizza Cutting and Josephus ProblemsRecurrent problems: TOH, Pizza Cutting and Josephus Problems
Recurrent problems: TOH, Pizza Cutting and Josephus Problems
MenglinLiu1
 
Concept of-complex-frequency
Concept of-complex-frequencyConcept of-complex-frequency
Concept of-complex-frequency
Vishal Thakur
 
129215 specimen-paper-and-mark-schemes
129215 specimen-paper-and-mark-schemes129215 specimen-paper-and-mark-schemes
129215 specimen-paper-and-mark-schemes
King Ali
 

Similar to Quiz1 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur (20)

linear transformation and rank nullity theorem
linear transformation and rank nullity theorem linear transformation and rank nullity theorem
linear transformation and rank nullity theorem
 
IIT Jam math 2016 solutions BY Trajectoryeducation
IIT Jam math 2016 solutions BY TrajectoryeducationIIT Jam math 2016 solutions BY Trajectoryeducation
IIT Jam math 2016 solutions BY Trajectoryeducation
 
Vector space
Vector spaceVector space
Vector space
 
Imc2017 day1-solutions
Imc2017 day1-solutionsImc2017 day1-solutions
Imc2017 day1-solutions
 
Dynamical systems solved ex
Dynamical systems solved exDynamical systems solved ex
Dynamical systems solved ex
 
Prin digcommselectedsoln
Prin digcommselectedsolnPrin digcommselectedsoln
Prin digcommselectedsoln
 
Mock cat solutions paper no 1
Mock cat solutions paper no 1Mock cat solutions paper no 1
Mock cat solutions paper no 1
 
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurEnd semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Olimpiade matematika di kanada 2017
Olimpiade matematika di kanada 2017Olimpiade matematika di kanada 2017
Olimpiade matematika di kanada 2017
 
02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf
 
02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf
 
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
 
3.-SEQUENCES-AND-SERIES-THEORY.hhsssspdf
3.-SEQUENCES-AND-SERIES-THEORY.hhsssspdf3.-SEQUENCES-AND-SERIES-THEORY.hhsssspdf
3.-SEQUENCES-AND-SERIES-THEORY.hhsssspdf
 
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurMid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Binômio de Newton 2
Binômio de Newton 2Binômio de Newton 2
Binômio de Newton 2
 
differential-calculus-1-23.pdf
differential-calculus-1-23.pdfdifferential-calculus-1-23.pdf
differential-calculus-1-23.pdf
 
Recurrent problems: TOH, Pizza Cutting and Josephus Problems
Recurrent problems: TOH, Pizza Cutting and Josephus ProblemsRecurrent problems: TOH, Pizza Cutting and Josephus Problems
Recurrent problems: TOH, Pizza Cutting and Josephus Problems
 
Concept of-complex-frequency
Concept of-complex-frequencyConcept of-complex-frequency
Concept of-complex-frequency
 
129215 specimen-paper-and-mark-schemes
129215 specimen-paper-and-mark-schemes129215 specimen-paper-and-mark-schemes
129215 specimen-paper-and-mark-schemes
 
Interpolation functions for linear triangle elements (very elementary)
Interpolation functions for linear triangle elements (very elementary)Interpolation functions for linear triangle elements (very elementary)
Interpolation functions for linear triangle elements (very elementary)
 

More from Vivekananda Samiti

More from Vivekananda Samiti (20)

End semester examination | MTH 653A, IITK Integral Equation
End semester examination | MTH 653A, IITK Integral Equation End semester examination | MTH 653A, IITK Integral Equation
End semester examination | MTH 653A, IITK Integral Equation
 
Mth 653 a end sem paper | Integral Equation
Mth 653 a end sem paper | Integral Equation Mth 653 a end sem paper | Integral Equation
Mth 653 a end sem paper | Integral Equation
 
Regression project report | Regression analysis | MTH 426 IITK
Regression project report | Regression analysis | MTH 426 IITK Regression project report | Regression analysis | MTH 426 IITK
Regression project report | Regression analysis | MTH 426 IITK
 
Project co prediction Regression analysis | MTH 426 IITK
Project co prediction Regression analysis | MTH 426 IITK Project co prediction Regression analysis | MTH 426 IITK
Project co prediction Regression analysis | MTH 426 IITK
 
Mth426 group13 final_report
Mth426 group13 final_reportMth426 group13 final_report
Mth426 group13 final_report
 
Indian eduaction system group 13 | MTH 423A IITK
Indian eduaction system group 13 | MTH 423A IITKIndian eduaction system group 13 | MTH 423A IITK
Indian eduaction system group 13 | MTH 423A IITK
 
Final presentation | MTH426A IITK
Final presentation | MTH426A IITKFinal presentation | MTH426A IITK
Final presentation | MTH426A IITK
 
Mth 416A, Regression Analysis - 2016 midsem, endsem and quizes
Mth 416A, Regression Analysis - 2016   midsem, endsem and quizesMth 416A, Regression Analysis - 2016   midsem, endsem and quizes
Mth 416A, Regression Analysis - 2016 midsem, endsem and quizes
 
Mth 416A end sem paper 2017, IITK
Mth 416A end sem paper 2017, IITK Mth 416A end sem paper 2017, IITK
Mth 416A end sem paper 2017, IITK
 
Mth 401 IITK theory of computation 2016
Mth 401 IITK theory of computation 2016Mth 401 IITK theory of computation 2016
Mth 401 IITK theory of computation 2016
 
Mth 412 IITK end sem paper 2016
Mth 412 IITK end sem paper 2016Mth 412 IITK end sem paper 2016
Mth 412 IITK end sem paper 2016
 
Phy 301 a end sem paper | Energy, IIT Kanpur
Phy 301 a end sem paper | Energy, IIT KanpurPhy 301 a end sem paper | Energy, IIT Kanpur
Phy 301 a end sem paper | Energy, IIT Kanpur
 
Phy 301 a Presentation
Phy 301 a Presentation Phy 301 a Presentation
Phy 301 a Presentation
 
Phy 301 a | Project Report
Phy 301 a | Project ReportPhy 301 a | Project Report
Phy 301 a | Project Report
 
Mth 523 end sem paper
Mth 523 end sem paper Mth 523 end sem paper
Mth 523 end sem paper
 
Fluidendsem | Mth 523 Fluid Dynamics | B V Rathish Kumar | IIT Kanpur
Fluidendsem | Mth 523 Fluid Dynamics | B V Rathish Kumar | IIT KanpurFluidendsem | Mth 523 Fluid Dynamics | B V Rathish Kumar | IIT Kanpur
Fluidendsem | Mth 523 Fluid Dynamics | B V Rathish Kumar | IIT Kanpur
 
Quiz3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz3 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurQuiz3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurProblem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Quiz2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz2 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurQuiz2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Problem set2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set2 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurProblem set2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 

Recently uploaded

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 

Recently uploaded (20)

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 

Quiz1 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur

  • 1. MTH 401: Theory of Computation August 17, 2016 Department of Mathematics and Statistics Time: 10 minutes Indian Institute of Technology - Kanpur Maximum Score: 10 Quiz Name Roll Number Let Σ = {0, 1}. Draw a deterministic finite state machine, M = (Q, Σ, δ, q0, F) that accepts the language containing binary strings that are not divisible by 3. In other words, draw M with L(M) = L = {w ∈ Σ∗ : w = (n)2 for some n ∈ N such that 3 | n}. Note that (n)2 denotes the binary representation of n and the symbol k | n denotes that k does not divide n. Justify your answer. [10] Solution: We need three states to keep track of the remainder as we read through the symbols of the binary number. Thus, Q = {0, 1, 2} where the label i indicate that the current remainder is i. The start state, obviously, is 0 and the set of final states is clearly F = {1, 2}. The first few step in the evolution of the remainder is shown in the figure below: More generally, to understand the transitions, let w be a string of length k such that w = (n)2. Then, clearly, n = k i=1 w(i)2k−i .
  • 2. 2 (for example, if w = 101, then (1)22 +(0)21 +(1)20 = 5.) Therefore, the string w0 correspond to k i=1 w(i)2k+1−i + (0)20 = 2 k i=1 w(i)2k−i = 2n and for the string w1, we have k i=1 w(i)2k+1−i + (1)20 = 2 k i=1 w(i)2k−i + 1 = 2n + 1. Now, if w = (n)2 is divisible by 3, i.e., n = 3m for some m, then 2n = 2(3m) = 3(3m) is still divisible by 3 whereas 2n + 1 = 2(3m) + 1 = 3(2m) + 1 leaves remainder 1 when divided by 3. Thus, δ(0, 0) = 0 and δ(0, 1) = 1 Similarly, if n = 3m + 1 for some m, then 2n = 2(3m + 1) = 3(2m) + 2, whereas 2n + 1 = 2(3m + 1) + 1 = 3(m + 1). Thus, δ(1, 0) = 2 and δ(1, 1) = 0 Finally, for an n of the form n = 3m + 2 for some m, 2n = 2(3m + 2) = 3(2m + 1) + 1 and 2n + 1 = 2(3m + 2) + 1 = 3(2m + 1) + 2 and hence, δ(2, 0) = 1 and δ(2, 1) = 2. Thus, the finite state machine, M can be drawn as shown in the figure below: