Calculate and display the mean of 1000 random numbers. The result should be close to

Assessment Specification Document: Distribution of Software
Generated Pseudo Random Numbers
Module Assessment
Table 1 summarizes the module assessment component and their respective ratios.
Table 1: Elements of the Module Assessment
Element Weight
A.1 Individual part 25%
Specification
This is the element A.1 with a ratio of 25% of the overall module assessment. It consists in
writing test programs in C programming language to assess the quality of a simple pseudo
random number generator based on the rand() function of “stdlib.h”. Please notice that in this
task we are NOT seeking generating real random numbers but just interested in investigating the
distribution of pseudo random numbers generated. The tests you are going to implement were
theoretically suggested by Kendall & Babbington-Smith over a series of papers published in
1938/39.
The rand() function returns a pseudo-random integer between 0 and RAND_MAX, which is
defined in stdlib.h. You should NOT replace it with a constant since its value may vary with
platforms. You need to rescale this value and fit it between 0 and 10 (0 included, 10 excluded).
To generate a single pseudo random number between 0 (included) and 10 in your code, you must
use the following: randon_number=(int)(10.0*rand()/(RAND_MAX+ 1.0));
Module: IoT Systems Security
2
Please notice it is required to use this instruction for all number generation instructions, so
do not make any change of this. Also, do NOT use or make change to the random variable
generator seeds. This may result in different distribution and failure to pass the tests.
Write a single code, randTest.c, that uses the instruction above to generate every single
number and implements all the tests given in table 2. Use the parsing command line arguments
through the main function (with a single character parameter after the file name) to select and
perform a single test in the runtime. E.g., suppose the executable file is named, ranTest.out,
if in the runtime one wishes running the first test, they just have to type “ranTest.out 1”, if
the second, “ranTest.out 2”, etc. Notice it is a requirement to use gcc and the MSc cyber
program VM to develop this code. Please refer to week 1 material for that.
Table 2: Tests
Test Deception
1. Mean test Calculate and display the mean of 1000 random numbers. The result should be close to
4.5.
2. Frequency test Tabulate the percentage of each digit (0 throughout 9) in 10,000 generated numbers.
Each Is expected to be close (roughly) to 10%.
3. Serial test Generate 10,000 pairs of numbers. Tabulate the percentage of each pair, 00, 01,02, …..,
99. This time we would expect roughly 1% in each category.
4. Poker test Generate four digits at a time, and repeat 1,000 times (a thousand sets of 4 digits in
total). Tabulate the cardinalities of the sets (the four digit tuples) as: i) all the same (e.g.
4444), ii) 3 digits the same (e.g. 4443, 3444 or 4344), iii) two pairs (e.g. 4334, 4433), iv)
one pair (e.g. 4324 or4342), or v) none identical. In theory we would expect 1, 36, 27,
432 & 504 for each set respectively for a thousand sets of numbers (i.e., 4,000 digits).
You will not necessarily get those exact numbers.
Module: IoT Systems Security
3
5. Pocker Test
using a file
Generate 4,000 random digits and save them in a text file (using ASCII coding), where
characters are separated by spaces and each line includes four characters. Repeat the
poker test by reading the numbers from the file.
Deliverables
For this part (Part A.1: individual E-portfolio), please upload:
• A single .c source file that is clearly organized and well commented. Please name it
randTest. Please make sure that the code correctly compiles with gcc without any
error. Failure to compile means failing all the test.
• Self-assessment form: using the template provided.
Marking criteria
• test 1: 8 points,
• test 2: 16 points,
• test 3: 16 points,
• test 4: 20 points, 4pt for each frequency (of each class).
• test 5: 25 points, 10pt for saving the generated numbers in a file, and then 3 for each
class.
• code quality: 15 points. Please not that the code quality marks can only be attributed
for the code that usefully compiles with gcc.
To get the maximum mark on each test you need to show that the random numbers are correctly
generating and matching the distribution. Matching the distribution does not mean reaching the
exact theoretical values given in the table, those are just indicative (you may reach them anyway).
Module: IoT Systems Security
4
To get points for “the quality of the code”, it should be easy to follow, commented, well
organized, modular (use of functions for repetitive actions), and all functions include clear
headers

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!