0% found this document useful (0 votes)
4 views10 pages

Recycling Vending Machine Overview

This document presents a report on a recycling vending machine project developed by a team as part of a computer science course. It outlines the machine's design using finite automata concepts, detailing its components, state diagram, and transition table to illustrate the system's functionality. The conclusion emphasizes the relevance of finite state machine modeling in enhancing user interaction and the potential impact of such machines on waste reduction in Malaysia.

Uploaded by

enthongy04
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views10 pages

Recycling Vending Machine Overview

This document presents a report on a recycling vending machine project developed by a team as part of a computer science course. It outlines the machine's design using finite automata concepts, detailing its components, state diagram, and transition table to illustrate the system's functionality. The conclusion emphasizes the relevance of finite state machine modeling in enhancing user interaction and the potential impact of such machines on waste reduction in Malaysia.

Uploaded by

enthongy04
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SECJ3203 | Theory of Computer Science

RECYCLING VENDING
MACHINE

Semester 01 2022/2023
Taught by: Dr Zalmiyah Zakaria

Section 01 | Team CS

Prepared by:

Name Matric No

Difa Ega Adrian A19EC0229

Wan Nurnabihah Mahfuzah Wan Mustapa B22CE0010

Hafidz Nailul Authar A19EC0238


Table of Contents

Task Distribution 3
Introduction 4
Formal Definition 5
State Diagram 7
Transition Table 8
Conclusion 10
Task Distribution

This report is made possible with the efforts of the following team members. Every task
is executed and monitored carefully by the group members in the hope to produce a good-quality
report on the recycling vending machine. Any feedback is appreciated.

Team member Tasks taken Monitored by

Adrian Formal definition Nurnabihah


Transition table

Nurnabihah Introduction Adrian


Flow chart Hafidz
State diagram

Hafidz Conclusion Nurnabihah


Introduction

Finite Automata is the simplest machine used to solve problems in computation. The
primary purpose of machines like these is to recognize and understand patterns, further develop
patterns to describe the dynamic behaviour of certain systems. More complex machines in the
course would be Pushdown Automata and Turing Machine. However, since finite automation
does not use any memory in its calculations, it is the perfect machine to incorporate into this
recycling vending machine project.

Recycling vending machines would help immensely in reducing plastic and foil waste.
Despite this machine not being widely available in Malaysia currently, the project intends to
highlight how the machine works using the Finite Automata concept that had been taught in this
course. Therefore, this report is written to document the processes taken in visualizing the
workaround of such a machine as well as the structure of its transitions.

In theory, this recycling vending machine has three primary components- a screen, a
recycling area (where users put in their items) and snack drawers. It also has requirements to be
fulfilled by the users in terms of the type of items (plastic bottles or cans) and the amount of the
items. Users who go by these requirements would receive rewards in the shape of snacks. As the
end result, the more a user recycles items, the more variety and number of snacks a user gets to
choose from.

That being said, if users decide to abort their recycling process before the system gets to
its final state, the accumulated items would be disregarded and users do not get to pick any
snacks. A similar output applies to a situation where users do not fulfill the requirements stated-
not enough plastic bottles to claim any snacks for instance. However, in this latter scenario, users
will still be given a few candies selected randomly by the machine as a token of appreciation at
the final state, unlike the former situation.
Formal Definition

In any computer science project such as this one, it is crucial to identify the formal
definition for the system as it can affect the corresponding diagrams and tables it needs to
visualize it. A finite automaton consists of a 5-tuple (Q, Σ, δ, q0 and F). According to the flow
chart (see Figure 1.0) created for the system, these values are defined below (the crossed-out
shapes).

Q{
S0: Shows info/idle mode.
S1: Asks the user to start the process.
S2: Shows how the recycling process works.
S3: Asks the user to confirm starting process.
S4: The user chooses the recycling item type.
S5: Updates screen each time user puts in another item.
S6: Lets the user choose the next step.
S7: Closes the recycling area.
S8: The user selects snacks where the values are sufficient for the items recycled.
S9: Displays thank-you note on the screen.
S10: Dispenses snacks/candies to the user.
}
Σ: Button choices {
a: Main path - where the user agrees with everything that the system suggests.
b: Termination path - where the user decides to abandon the process.
c: Reselection path - where the user chooses to reselect the item type.
}
δ: Transitions when choices of actions are made.
q0/S0: Home screen/beginning/idle.
F: When snacks/candies come out.
Figure 1.0 Flow chart of the recycling vending machine system.
State Diagram

A state diagram is constructed for the purpose of this project (refer to Figure 1.1). The
diagram helps clarify the transitions as well as the other 5-tuple mentioned previously. It gives an
abstract description of the behaviour of a system where it can be analyzed and represented
through a series of events (states) that may occur in none, one or more next states. This makes
the system a non-deterministic finite automaton (NFA).

Figure 1.1 demonstrates the state diagram with a total of 11 states.


Transition Table

Based on the state diagram provided, a table transition can be found in Table 1.0. There
are several loops circulating in states S4, S5, S6, S8 and the last one in state S10. These loops are
made to demonstrate repeated actions made by the system to keep the system running as
intended with each providing a different function.

The loop implemented in states S5 and S6 serves to update the screen of the vending
machine after the user puts in each recycling item. A few ways to break this loop are by having
the user picks their next path (buttons displayed on the screen) whether to complete putting items
(a), abandon the process (b) or choose a different item type to recycle (plastic bottles to cans and
vice versa). If the user chooses c, another loop cycle will restart from state S4 until state S6.

Furthermore, state S8 has a loop in which the user needs to select the snacks within the
value that is sufficient with the items recycled. The system will key in each snack selection and
keep doing so until there is no balance of snacks the user can choose anymore. Once that is
achieved, the loop is broken and directed to state S9.

The loop implemented in state S10 comes after the system has gone through state S9
where the screen shows a thank-you display. The system dispenses the chosen snack one by one
based on the choices made shortly before (hence the loop). When there is no snack left to give
out, the whole process of recycling finishes. This makes state S10 to be a final state, apart from
state S0.
States a b c

S0 S1 - -

S1 S2 S0 -

S2 S3 - -

S3 S4 S0 -

S4 S5 - -

S5 S6 - -

S6 S7, S5 S7 S4

S7 S8 S9 -

S8 S8, S9 - -

S9 S10 S10 -

S10 S10, S0 S10, S0 -

Table 1.1 Transition Table of all the states.


Conclusion

The proposed project is conducted with guidance from the lecturer and lessons in the
Theory of Computer Science course. Finite State Machine (FSM) modelling holds a major part
in succeeding the recycling vending machine’s system model. From the study, it can be
concluded that the machine indeed uses FSM specifically the non-deterministic type in running
the operation. This is proved through the state diagram and transition table where a state can
have several next-state options. Moreover, there is no one definite exiting transition arrow for
some of the states in the machine. Recycling vending machine is not yet a familiar machine
available out there widely, more so in Malaysia. Therefore, the structure of non-deterministic
automata allows users to feel more in control of the system and makes them more inclined to use
it as they may terminate during certain points if they are new to such a system. Thus, this report
solidifies the importance of computer science theories in our daily life convenience.

You might also like