You are on page 1of 1

Course CSD 303

Practice Problems 1
Date: 24th January 2017
Give a Finite State Automata (DFA and NFA) for the following.
Instructions:

If there cannot be a finite automata for the defined problem, explain why there cannot
be a solution.
The inputs and conditions are not limited to what specified in the question. You are
welcome to use your own imagination for designing the machine.
If the DFA construction involves too many states, you can restrict to NFA and give the
DFA for one input.

Questions:
1. Vending Machine Accept 20 rupees and dispense Coffee/Tea according to the input
selected by user. The user first inserts 20 rupee coin in different denominations of {1,
2, 5 and 10}. Once the coins are accepted, the user can select Coffee/Tea {Input 1 for
Coffee and 2 for Tea}.
2. Traffic at Cross Roads In absence of traffic signals, the vehicles are supposed to
decide whether to cross without creating any hassles. You are required to design a
finite automata to help the vehicles in taking decision as to whether to move forward
or wait. You accept the input if the decision is to move forward, else it is not accepted.
3. Washing Machine Automatic washing machines have different states such as, PreWash, Wash, Rinse, Spin and Dry. They can be washed either in Hot/Cold water and
the RPM for spin is also dependent on the type of cloth. Based on the clothes, the
functionalities vary and some of the conditions are as follows:
a. Synthetic clothes cannot be washed in hot water and the temperature setting
should be below 30.
b. Woolen clothes cannot have pre-wash option and spin RPM not more than
400.
c. Cottons are washed in cold water and RPM can be up to 800
You are required to define a finite automata considering different states and inputs as
water temperature, clothes and RPM.
4. Solve question Ex. 2.2.1 in Ulman and Hopcroft book (Pg. 53 In PDF version).
5. Give the DFA for pattern matching. In a pattern of string length N, you are required
to find whether there is a string of length M present in the input, where M<N.
For example in the pattern (N) T I O P S N U K L E R and the string of length 3
(M) as SNU, you should be able to say, whether the particular string is accepted or
not. If M is present in N, the DFA is accepted.

You might also like