The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

0 votes

your initial state =**n _{0}**

let assume it as **0**... while **reading 'a'** going to one state forward...that implies **adding 1** to previous state

while **reading 'b'** going to one state backward... that implies **decreasing 1** to previous state...

if you have **same no.of a's and b's** ===> finally you are at **initial position** only

but you are aim is go to **n _{5} only**.....therefore you should have

0 votes

Answer: B

Starting with state {0},encountering 'a' would add 1 to present state and encountering 'b' would subtract 1 from present state.Since the final state is {5} hence the accepted strings will be a^5,a^6 b,a^7 b^2,... considering an 'a' as +1 and 'b' as -1.Hence the number of a's is 5 more than b.

Starting with state {0},encountering 'a' would add 1 to present state and encountering 'b' would subtract 1 from present state.Since the final state is {5} hence the accepted strings will be a^5,a^6 b,a^7 b^2,... considering an 'a' as +1 and 'b' as -1.Hence the number of a's is 5 more than b.

- All categories
- General Aptitude 1.4k
- Engineering Mathematics 5.9k
- Digital Logic 2.3k
- Programming & DS 4.2k
- Algorithms 3.7k
- Theory of Computation 4.6k
- Compiler Design 1.7k
- Databases 3.4k
- CO & Architecture 2.9k
- Computer Networks 3.3k
- Non GATE 1.2k
- Others 1.3k
- Admissions 506
- Exam Queries 482
- Tier 1 Placement Questions 22
- Job Queries 64
- Projects 15

40,861 questions

47,532 answers

145,982 comments

62,293 users