1 votes 1 votes The number of states in a minimal DFA that accepts set of all strings beginning with 1 that, when interpreted as a binary integer is a multiple of 5 over the alphabet={0,1}. For example, strings 101, 1010 and 1111 are in the language? anjali007 asked Jan 6, 2019 anjali007 4.9k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Shubhgupta commented Jan 6, 2019 i edited by Shubhgupta Jan 6, 2019 reply Follow Share 6 states? (0 should be rejected right?) 0 votes 0 votes anjali007 commented Jan 6, 2019 reply Follow Share ya.. can u pls explain how? 0 votes 0 votes Shubhgupta commented Jan 6, 2019 reply Follow Share answer added. 0 votes 0 votes Please log in or register to add a comment.
Best answer 2 votes 2 votes Make DFA for divisible by 5 and exclude '0' string from that DFA So based on this minimal DFA will have 7 states and looks like below- Approach is- in divisible by 5 DFA there will be 5 equivalence classes{0,1,2,3,4} and as mentioned in question strings are start with 1 so we need to reject all string with 0. Shubhgupta answered Jan 6, 2019 • selected Jan 7, 2019 by anjali007 Shubhgupta comment Share Follow See all 9 Comments See all 9 9 Comments reply anjali007 commented Jan 7, 2019 reply Follow Share @Shubhgupta ur dfa is accepting the strings that are starting with zero.. u should add a dead state transition for zero from q0.... so the no of states will be 7 as said by you earlier.. can u plz explain what procedure did u follow for the states q1,q3,q2,q4,q5.. 0 votes 0 votes Shubhgupta commented Jan 7, 2019 reply Follow Share @anjali007, i have previously added that dead state but it doesn't make more sense because if a string 0101 then its binary equivalent is 5 right? but i think as mentioned in question DFA accepts stating with 1 only. Correct image added. 0 votes 0 votes anjali007 commented Jan 7, 2019 reply Follow Share @Shubhgupta and for the rest of the five states did u follow any "particular approach" or just analysed the states? 0 votes 0 votes Shubhgupta commented Jan 7, 2019 reply Follow Share @anjali007, as i mentioned in answer q1 represents string with 1 remainder, q2 with 2 remainder, q3 with 3 remainder and q4 with 4 remainder. and i have created qf new because we don't want to accept 0. is it clear? 0 votes 0 votes anjali007 commented Jan 7, 2019 reply Follow Share Yup...thanks 0 votes 0 votes jatin khachane 1 commented Jan 15, 2019 i edited by jatin khachane 1 Jan 16, 2019 reply Follow Share @Shubhgupta Please check if this is the apporach you used first considering : Integer of binary string as multiple of 5 ==> 5 states q0,q1,q2,q3,q4 0 1 -->*q0 q0 q1 q1 q2 q3 q2 q4 q0 q3 q1 q2 q4 q3 q4 Now we have to ignore strings starting with one hence after modification of transitions we get dfa as in selected and if starting with 1 condition not mentioned then it will '6' states right?? 0 votes 0 votes Shubhgupta commented Jan 15, 2019 reply Follow Share yes approach is correct but 5 states will be q0,q1,q2,q3,q4 not q5. 0 votes 0 votes jatin khachane 1 commented Jan 15, 2019 reply Follow Share Ya tht was done in hurry 0 votes 0 votes bhanu kumar 1 commented Jan 15, 2019 reply Follow Share is This Logic Right or Not? we know modulo 5 DFA need minimum 5 state, in this all state work in cycle with each other state. Here 0 is not start point means we have to reject it so 1 extra state for it and also State 0 is not doing its work so we need 1 Extra state for it to do the job of it. so total 5+1+1=7 1 votes 1 votes Please log in or register to add a comment.