Automatic Newspaper Vending Machine Finite Automata

By: Prof. Fazal Rehman Shamil
Last modified on August 5th, 2020

Automatic Newspaper Vending Machine Finite Automata (DFA or FA).

Case Study 1 of Newspaper Vending Machine DFA Finite Automata

Suppose you need to design a Deterministic Finite Automata for Newspaper Vending Machine. You need to insert only three coins.

Suppose our language has three alphabets {1,2 5}.

Detail of coins:

You have only three types of coins.

  1. Coin of 1 Rupee
  2. Coin of 2 Rupee
  3. Coin of 5 Rupee

The machine only accepts a total of 7 Rupees. If 7 Rupee coins are inserted into the machine then machine allows you to get the newspaper. The person who gives a total of 7 Rupee coins to the machine, can only get the newspaper from the machine.

Coins-Machine-DFA-Finite-Automata

Case Study 2 of Newspaper Vending Machine DFA Finite Automata

Suppose you need to design a Deterministic Finite Automata for Newspaper Vending Machine. You need to insert only three coins.

Suppose our language has three alphabets {1,2 5}.

Detail of coins:

You have only three types of coins.

  1. Coin of 1 Rupee
  2. Coin of 2 Rupee
  3. Coin of 5 Rupee

If 7 Rupee or more than 7 rupee coins are inserted into the machine then machine allows getting the newspaper. The person who gives a total of 7 Rupee or more than 7 rupee coins to the machine, can only get the newspaper from the machine. It is important to note that if the user inserted the coins of more than 7 rupee worth, then the machine accepts the coins and does not return the remaining amount to the customer.

Strings must be accepted by machine :  L = {25,  115,  125,  225,  1125,   1222, 1225…..}
Strings must be rejected by machine: L = {1,  2,  5,  11,  12,  15,  22,  111,   112,  55,  155, etc …}
FA finita AutomataNewspaper vending machine

Prof. Fazal Rehman Shamil