1 / 6

NCCS RYK Campus Theory of Automata

NCCS RYK Campus Theory of Automata. Assignment 1 Powered by Muhammad Umair. Task.

amora
Download Presentation

NCCS RYK Campus Theory of Automata

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NCCS RYK CampusTheory of Automata Assignment 1 Powered by Muhammad Umair

  2. Task • Q) Prove that there are as many palindromes of length 2n, defined over Σ = {a,b,c}, as there are of length 2n-1, n = 1,2,3… . Determine the number of palindromes of length 2n defined over the same alphabet as well. Theory Of Automata

  3. Solution • To calculate the number of palindromes of length(2n), consider the following diagram, Theory Of Automata

  4. which shows that there are as many palindromes of length 2n as there are the strings of length n i.e. the required number of palindromes are 3n (as there are three letters in the given alphabet, so the number of strings of length n will be 3n ). Theory Of Automata

  5. To calculate the number of palindromes of length (2n-1) with a as the middle letter, consider the following diagram, Theory Of Automata

  6. which shows that there are as many palindromes of length 2n-1, with a as middle letter, as there are the strings of length n-1, i.e. the required number of palindromes are 3n-1. Similarly the number of palindromes of length 2n-1, with b or c as middle letter, will be 3n-1 as well. Hence the total number of palindromes of length 2n-1 will be 3n-1 + 3n-1 + 3n-1 = 3 (3n-1)= 3n . Theory Of Automata

More Related