Vending machines and mathematics

Summary: Ubiquitous vending machines use algebra and Boolean logic to function.

Vending machines are finite state machines, also known as “automata,” that transition between states based on customer input data, such as product selection. Vending machine designers use mathematical models and Boolean algebra to determine the states the machine should transition into based on input data variables, with the outcome often expressed as a table. The control unit reads the data as either “true,” meaning the machine recognizes the input language, or “false,” meaning that it does not.

98697163-91199.jpg98697163-91210.jpg

The first documented vending machine, invented by the Egyptian mathematician Hero of Alexandria, appeared c. 215 b.c.e. By the twentieth century, vending had developed into a billion dollar industry, and vending machines dispensed a variety of products. Older vending machines relied on the mechanical activity of knobs or levers activated by the customer to dispense the desired product. Vending machine operators utilize mathematics to determine potential and actual expenses and profits, as well as to process sales and stock data. For example, net income can be determined through the simple formula: Net Income=Income-Expenses.

Modern vending machines, however, utilize basic computing system processors to analyze customer input data, such as a letter and number, that corresponds to the desired product, which is then electronically dispensed. Modern advances in vending machine technology include card validators for debit and credit cards; voice activation; electronic message displays for insufficient funds, lack of change, or sold out products; and remote wireless diagnostics and data collecting to alert venders of the need for restocking or repair.

Vending machine control units are part of a class of abstract machines known as “finite state machines” or “automata”; in particular, they are deterministic or discrete finite state automata (DFA). Finite state machines are always in a position known as a “state,” transitioning between these states based on input data. Designers use mathematical models in the design of finite state machines, such as vending machines. The machines are designed to recognize a regular language, converting computation into language recognition. Each state is labeled either “true” (accept the data) or “false” (reject the data) based on whether the machine recognizes the language of the input data.

Vending machine design utilizes Boolean logic or algebra, or algebra based on two logical values, in this case the values of “true” and “false.” The general Boolean function is expressed through the formula

where (x,…) is equal to a set of Boolean variables with the values “true” or “false.” Diagrams of the various states of the vending machine and the possible transitions between them can be converted into Boolean operations.

The control unit reads each string of input data, generally input from the vending machine customer, such as the diameter, thickness, or number of ridges of coins followed by product selection codes. Transition functions tell the machine which state it should enter based on input data. Transition functions are often represented in tabular form. The control unit changes its state with each data string entered until the final input, after which it outputs either “true” or “false” based on its final state. Vending machines also use the algebraic relationship between range and domain, where the range is the machine’s output and domain is the customer’s input. For example, a customer must input an equal or greater amount of money than the cost of the desired product.

Bibliography

Hopcroft, John E., and Jeffrey D. Ullman. Introduction to Automata Theory, Languages, and Computation. Reading, MA: Addison-Wesley, 1979.

Salomaa, Arto. Computation and Automata. New York: Cambridge University Press, 1985.

Salyers, Christopher D. Vending Machines: Coined Consumerism. Brooklyn, NY: Mark Batty Publisher, 2010.

Segrave, Kerry. Vending Machines: An American Social History. Jefferson, NC: McFarland & Company, 2002.