Posts

Day three of theory of computation

Image
 1. Non-deterministic Finite Automata (NFA)   Unlike a DFA, an NFA allows a machine to explore multiple paths simultaneously.   Definition: For a given state and input symbol, an NFA can transition to zero, one, or multiple states . Acceptance: A string is accepted if at least one possible path leads to a final state. Flexibility: NFAs are generally easier to construct than DFAs because you don't need to define transitions for every possible input or worry about "dead states".   2. NFA with Epsilon Transitions ( 系 epsilon 饾湒 -NFA)   An 系 epsilon 饾湒 -NFA introduces the epsilon ( 系 epsilon 饾湒 ) move , which allows the machine to change states without consuming any input symbol.   系 epsilon 饾湒 -Closure: This is a critical Day Three concept. It is the set of all states reachable from a specific state using only 系 epsilon 饾湒 transitions (including the state itself). Use Case: 系 epsilon 饾湒 -NFAs are highly useful for combining smaller machines (e.g., when ...

day two of theory of computation

Image
 1. The Formal Definition (The 5-Tuple)   A DFA is mathematically defined as a 5-tuple M = ( Q , 危 , 未 , q 0 , F ) cap M equals open paren cap Q comma cap sigma comma delta comma q sub 0 comma cap F close paren 饾憖 = ( 饾憚 , 危 , 饾浛 , 饾憺 0 , 饾惞 ) :   Q cap Q 饾憚 : A finite set of states (e.g., { q 0 , q 1 , q 2 } the set q sub 0 comma q sub 1 comma q sub 2 end-set { 饾憺 0 , 饾憺 1 , 饾憺 2 } ). 危 cap sigma 危 : A finite set of symbols called the alphabet (e.g., { 0 , 1 } the set 0 comma 1 end-set { 0 , 1 } ). 未 delta 饾浛 : The transition function , defined as 未 ∶ Q × 危 → Q delta colon cap Q cross cap sigma right arrow cap Q 饾浛 ∶ 饾憚 × 危 → 饾憚 . This ensures that for every state and input, there is exactly one destination state. q 0 q sub 0 饾憺 0 : The start state ( q 0 ∈ Q q sub 0 is an element of cap Q 饾憺 0 ∈ 饾憚 ). F cap F 饾惞 : The set of accept states or final states ( F ⊆ Q cap F is a subset of or equal to cap Q 饾惞 ⊆ 饾憚 ).   2. Key Rules of DFA Design   Determini...