Model a system using mathematical logic constructs to
describe how the system works. You should fully describe the constructs you are using,
including any assumptions, and justify your modelling assertions.
Learning Outcome to be assessed
• Apply appropriate mathematical concepts and operations to solve problems
• Evaluate possible solutions to problems, and defend the chosen solutions
Created in Master PDF Editor
Document title Modelling Exercise
Revision 1.1
Date 08/09/20
Author MJR
Detail of the task
Part A:
As the Internet of Things (IoT) becomes more prevalent with the integration of more smart
devices onto networks, software will be needed to manage and control these devices. At the
software control level, the operational rules required will consist of logical statements. For
example, consider a simple smart Vending Machine, dispensing just one product. The machine
will accept coins (or maybe credit cards, mobile phone payments, etc.) and allow a product to
be dispensed only in circumstances where the correct amount for the product has been
received, by the machine, and the product has ben requested.
- If P is the assertion that the correct money has been received, Q is the assertion that the
product has been requested and R is the assertion that the product will be dispensed, then
represent these facts in a statement using logical propositions and connectives.
[5 Marks] - Using the assertions P and Q, from A1, and logical connectives represent the statement:
The correct money has been received or the product has been selected and it is not the
case that both the product has not been selected and the correct money has been inserted,
then simplify the resulting expression using laws of logical equivalence.
[8 Marks] - If the correct money has been received and the product has been selected then the product
will be dispensed (as represented in A1). Again, representing P as the correct money has
been inserted with Q the assertion that the product has been requested and R the assertion
that the product will be dispensed, represent the converse, inverse and contrapositive of this
assertion and comment on the truth-value of these, if the assertion (from A1) is known to be
true.
[8 Marks] - Represent the following statements in logic sentences:
i. If the correct money is inserted then if the product is selected then the product
will be dispensed
ii. If the correct money is inserted and the product is not dispensed then the
product has not been selected.
iii. If the product is not dispensed then the correct money has not been inserted or
the product has not been selected
iv. If it is not the case that the correct money has not been inserted or the product
has not been selected then the product will be dispensed.
[8 Marks] - Construct a truth table for the logic sentences in question A4 and comment on the
equivalence or otherwise of the statements.
[16 Marks]
Created in Master PDF Editor
Document title Modelling Exercise
Revision 1.1
Date 08/09/20
Author MJR
Part B:
Vending machines are, of course, now much more sophisticated than the one described in section
A, above. There can be multiple items to choose from; stock can be monitored, for freshness and
level, and the machine itself can alert to signal a restock, coins can be checked for validity;
change given; personal accounts maintained; customer detection with a personal message, etc.,
etc. Additionally, to cope with his added complexity, predicates need to be used instead of the
propositions used in section A. For example, as there are multiple items that can be dispensed,
a predicate dispense(x) could be used to mean product x is dispensed by the machine (e.g.
dispense(StarBurst_tube)) - Describe, in your own words and with diagrams if necessary, a description for the operation
of a Vending Machine. Your machine should be ‘state of the art’ and dispense a number of
different products with varying prices, accepting different coins/notes.
[15 Marks] - List the different states that the vending machine, you have described, can be in and
discuss the conditions that dictate the entering and leaving of these states. For example, the
machine could go from an idle state to a validate_coin state by the insertion of a coin into
the machine.
[15 Marks] - Fully specify, using propositions, predicates, quantifiers and logical connective symbols in
logic sentences, the working of the Vending Machine you have described to show state
changes and conditions for operations.
[25 Marks]