Question

In: Computer Science

BRING 4 CHALLENGING QUESTION WITH SOLUTION FOR THE FOLLOWING QUESTION 1. Using MOD function with concept...

BRING 4 CHALLENGING QUESTION WITH SOLUTION FOR THE FOLLOWING QUESTION

1. Using MOD function with concept explanation for DFA ( DFA WITH MODE FUNCTION)

Please do not upload simple question and question that available on the internet .....it must be challenging

Thank you

Solutions

Expert Solution

Question 1

Construct DFA for the language L = {w | w ∈ {a,b}* and Na(w) mod 3 = Nb (w) mod 3}.

Note:  L={w | Na(w) = Nb(w)mod 3} which means all string contain modulus of count of a’s equal to modulus of count of b’s by 3.

Eg:

Input: a a b b b
Output: NOT ACCEPTED
Because n = 2, m=3 (2 mod 3! = 3 mod 3)

Input: a a b b
Output: ACCEPTED
Because n = 2, m = 2 (2 mod 3 = 2 mod 3)

Solution:(Step by step)

  • Construct FA for {w | w {a, b}} and Na = 0 mod 3 means having a’s as a multiple of 3.
  • Construct FA for {w | w {a, b}} and Nb = 0 mod 3 means having b’s as a multiple of 3.
  • Concatenate the two FA and make single DFA using Concatenation process in DFA.
  • Making state as final state which accepts the equal modulus count for a’s and b’s.

DFA State Transition Diagram:

Question 2

Design a deterministic finite automata (DFA) for accepting the language

Regular expression for above language L is,

Input:  a a b b b           
Output:  ACCEPTED
// n = 2 (even) m=3 (>=1)

Input:  a a a b b b         
Output:  NOT ACCEPTED
 // n = 3 (odd), m = 3

Solution:

  1. Construct FA for means having even number of a’s.
  2. Construct FA for means having any number of b’s greater than one.
  3. Concatenate the two FA and make single DFA.

Any other combination result is the rejection of the input string.

DFA State Transition Diagram:

Question 3:

Construct a DFA which accept the language L = {anbm | n > =1, (m) mod 3 = 1}.

When it comes to solution always keep the below point:

" which means any no of elements, and
 which means any no of elements greater than 1."
Input: a a b b b           
Output: NOT ACCEPTED
// n = 2 (>=1), m=3 ((3) mod3 != 1)

Input: a a a b        
Output: ACCEPTED
 // n = 3 (>=1), m = 1 ((1) mod 3= 1)
  • Construct FA for means having any number of a’s greater than one.
  • Construct FA for means having exactly
  • Construct FA for means having b’s equal to multiple of 3 .
  • Concatenate the three FA and make single DFA. Always maintain the order of a, b and c.

DFA State Transition Diagram:

Question 4:

Construct a DFA to accept all strings which satisfy w(x)mod 5 =2 .

Lets go directly to the transition diagram now:

State 0(Input alphabet) 1(Input aphabet)
q0 q0 q1
q1 q2 q3
*q2 q4 q0
q3 q1 q2
q4 q3 q4

Now by above state table draw DFA and make q2 as a final state bcz    w(x)mod5=2

The state diagram

Above mentioned some of the challenging questions in the field of NFA which I felt good. Also all are related with mod.


Related Solutions

Solve a system of equations: 1- 2x = 5 mod 15   3x = 1 mod 4...
Solve a system of equations: 1- 2x = 5 mod 15   3x = 1 mod 4 2- x = 5 mod 15 x = 2 mod 12 (Hint: Note that 15 and 12 are not relatively prime. Use the Chinese remainder theorem to split the last equation into equations modulo 4 and modulo 3)
Determine the solution of the following equation mod N. 1.7x≡2 mod 15, where N= 15 2.x≡8...
Determine the solution of the following equation mod N. 1.7x≡2 mod 15, where N= 15 2.x≡8 mod 11, x≡3 mod 19, where N= 209 3.x≡2 mod 7, x≡2 mod 11, x≡1 mod 13, where= 1001
prepare a 4-page paper on how the concept of compounding can bring wealth and how has...
prepare a 4-page paper on how the concept of compounding can bring wealth and how has technology changed investing. please include references
1. compute the least non-negative residue of 4^n (mod 9) for n=1,2,3,4,5.... prove that 6*(4^n)=6 (mod...
1. compute the least non-negative residue of 4^n (mod 9) for n=1,2,3,4,5.... prove that 6*(4^n)=6 (mod 9) for every n>0. 2. find nice tests for divisibility of numbers in base 34 by each of 2,3,5,7,11,and 17. 3. in Z/15Z, find all solutions of : (i) [36]X=[78]. (ii) [42]X=[57] (iii) [25]X=[36] 4. in Z/26Z, find the inverse of [9], [11], [17], and [22] 4. write the set of solutions of x=5 mod24. x=17 (mod 18) for all equation line, there are...
Question 1: Using the appropriate interest table, provide the solution to each of the following questions...
Question 1: Using the appropriate interest table, provide the solution to each of the following questions by computing the unknowns. (a) What is the amount of the payments that Jonathon must make at the end of each of 12 years to accumulate a fund of $220,000 by the end of the twelfth year, if the fund earns 6% interest, compounded annually? (b) Amanda is 30 years old today and she wishes to accumulate $2,500,000 by her sixty- eighth birthday so...
Design a decoder counter MOD '10' that counts from 0-9 using 4 flip flops and a...
Design a decoder counter MOD '10' that counts from 0-9 using 4 flip flops and a NAND gate.
Question 1 Explain the following accounting concepts:   a.Business entity concept   b.Matching concept     c.Going concern   d.Accruals concept  ...
Question 1 Explain the following accounting concepts:   a.Business entity concept   b.Matching concept     c.Going concern   d.Accruals concept   e.Consistency concept
1. A clear step by step formulation and solution (using Hamiltonian function) of the two body...
1. A clear step by step formulation and solution (using Hamiltonian function) of the two body problem relative to inertial frame of reference. 2. A clear step by step formulation and solution (using Hamiltonian function) of the two body problem relative to a non-inertial frame of reference.
prove that for x is an odd, positive integer, 3x ≡−1 (mod 4). I'm not sure...
prove that for x is an odd, positive integer, 3x ≡−1 (mod 4). I'm not sure how to approach the problem. I thought to assume that x=2a+1 and then show that 3^x +1 is divisible by 4 and thus congruent to 3x=-1(mod4) but I'm stuck.
Using Python Question 1 Write an input function. Then use it to supply the input to...
Using Python Question 1 Write an input function. Then use it to supply the input to following additional functions: i) Print multiplication table of the number from 1 to 12. ii) Print the sum of all the numbers from 1 to up the number given. iii) Print if the number supplied is odd or even. Question 2 Write function that asks for input from a user. If the user types 'end', the program exits, otherwise it just keeps going.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT