This final part of the project is the last for the birthday
paradox program and combines everything from the modules to
simulate the scenario of people in a group sharing a birthday. For
this task you’ll be required to create a Graphical User
Interface (GUI) that calls the user-defined
functions you created in module 2 to help perform the
simulation.
Graphical User Interfaces are what we’re most
familiar with when using computer programs; they consist of pop-up
windows with buttons, text boxes, drop-down menus, radio buttons
and other graphical elements that can be interacted with by a user
to input information into the program.
User-defined functions allow for effective code
reuse and is good programming practice when creating programs that
require the same or similar code to be executed many times.
function out = MyFunction(in1, in2) % Rename function and
input/output variables to appropriate name (not MyFunction)
% Insert code here to perform appropriate functions.
out = % Set output variable to the appropriate value
Assessment Requirements:
For this part of the project, you’re required to simulate the
birthday scenario:
Call your function from module 2a to assign random birthdays to
people in an
increasingly large group of people (starting with a group size of 2
people and ending
with a group size of 365). This function can be modified so it just
generates whole
numbers from 1 to 365 to represent each day (rather than the
day/month format
from module 2a), this will make the program less computationally
complex but will
still give you the same result.
Use the function from module 2b to check these dates to see if
there are any
repeated birthdays in the groups. Keep a record of
any matches discovered.
- Using the knowledge gained from module 1, you’ll then plot a
graph of the
probabilities of a shared birthday from your
simulation with a graph of the
theoretical model overlayed (x-axis = group size,
y-axis = probability). The graph
must be displayed on your GUI (so you’ll use app.UIAxes to display
your results).
To obtain a close statistical model to the theory, you’ll need
to repeat your simulation
many times and take the average over the number of realisations (at
least 10 times, but less
than 500 times to ensure the simulation doesn’t take too long).
Other GUI Functionality and Considerations:
How many realisations does the user want in order to obtain
an estimate of the
probability of a shared birthday (allow user to select numbers
between 10 and 500).
This will allow the simulation to either be fast but less accurate
(10 times) or slow
and more accurate (500 times).
The maximum group size the user wants simulated. This
will truncate the graph to
the maximum group size. The range of this must be a minimum of 2
people and a
maximum of 365 people in a group.
You’ll need to think not only about the way your program
calculates the output required to
solve the problem (its functionality) but also how your GUI will
look (its aesthetics) and how
simple it is for a user to input and receive output from your
program (its usability).
Your graphical user interface (GUI) must be created in App
Designer (DO NOT use the
menu() or dialog() functions or GUIDE!!!). You must submit the
.mlapp file and user-
defined functions in .m file format for assessment.
MATLAB
Please find this ........
- A problem statement
- An algorithm design (in the form of
flow-charts)
- MATLAB files (including the GUI file (.mlapp) and
your user-defined function files (.m files)). A .zip file
containing these files will also be acceptable.
- Evidence that you have testing your program and
ensured it outputs results consistent with the
theory.
This final part of the project is the last for the birthday paradox program and combines everything from the modules to
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
This final part of the project is the last for the birthday paradox program and combines everything from the modules to
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!