--%>

State machine to identify three consecutive heads

Explain a finite state machine which will detect three consecutive coins tosses of one coin which results in heads?

E

Expert

Verified

State machine to identify three consecutive heads appearing within multiple tosses;

State 1: initial state
So long as the toss results within TAIL, in this state when the toss results in HEAD go to state 2.

State 2: HEAD1 resulted within the next toss; when TAIL is resulted go to the initial state1.
When HEAD is resulted go to state3.

state3: HEAD2 is resulted in the next toss; when TAIL is resulted go to the initial state1.
When HEAD is resulted go to state4.

state4: HEAD3 is resulted and it is the last state
So long as the HEAD results in each next toss be in state 4. When any toss results in TAIL go to initial state1.

   Related Questions in Programming Languages

  • Q : Types of rings in CPU Name the

    Name the different kinds of rings presented in CPU?

  • Q : Define Little-endian Little-endian : It

    Little-endian: It is a common difference among machines is the order in which they store up the individual bytes of multi-byte numerical data. The little-endian machine stores the lower-order bytes prior to the higher-order bytes.

  • Q : What is MIME MIME : Multipurpose

    MIME: Multipurpose Internet Mail Extensions (abbreviated as MIME) are rules which make it possible to utilize electronic mail to send content other than the simple text.

  • Q : Software Quality Assurance and Software

    What real-life experience have you gained along with Software Quality Assurance as well as Software Quality Control?

  • Q : Define the term Catching exceptions

    Catching exceptions: Exceptions are caught in the catch clause of the try statement. Catching an exception provides the program a chance to recover from the trouble or attempt a repair for whatsoever caused it.

  • Q : Define Well-known port Well-known port

    Well-known port: It is a port number at which a server provides a familiar service. For example, 80 is well-known port number for the servers employing the HyperText Transfer Protocol (abbreviated as HTTP).

  • Q : State the term non-XML resources State

    State the term non-XML resources?

  • Q : Illustrates XML is an important

    Illustrates XML is an important development.

  • Q : Explain Recursion Recursion : Recursion

    Recursion: Recursion outcomes from a method being invoked whenever an existing call to the similar method has not yet returned. For example:     public static void countDown(int n){  

  • Q : Define Thread starvation Thread

    Thread starvation: It is a condition which applies to a thread which is prevented from running by other threads which do not yield or turn into blocked.