Question: [Java], [C++], or [MATLAB] can be used! This program can be written in C/C++ java or MATIAB that generates a histogram that shows the percentage
[Java], [C++], or [MATLAB] can be used!
![[Java], [C++], or [MATLAB] can be used! This program can be written](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f323107d28c_25566f3230fcbbcd.jpg)
This program can be written in C/C++ java or MATIAB that generates a histogram that shows the percentage or relative frequency of packet trains that are of a certain length A "packet train of length i is a sequence of i consecutive packet (with no gaps or idle slot in between) In a given time lot the probability that a station has a single packet to transmit in p The probability of no packet in a slot (idle slot) in I-p One packet fills one time lot. In your program you will need to use a random number generator function to simulate the probability that a slot has a packet or not For each of three values of p you will plot a histogram showing the relative frequency of packet trains of length i. The horizontal axis of the histograms will be the packet train length (i = 1.2.3...) and the vertical axis will be the recorded relative frequency You will generate histograms for p = 0.2. p = 0.5 and p = 0.9. Also consider the number of time slot to be 100.000. Increase the number of slots if any curve(s) is too bumpy. Record the percentage or relative frequency of each packet train length for the above three packet transmission probabilities The relative frequency of a packet train of length i the number of times that packet train of length i occurs divided by the total number of packet trains of all lengths found in your simulation Output of your program: Create a histogram showing the relationship of the packet train length and the percentage or relative frequency of that specific packet length Your graph should be such that packet train length on the X-axis and the Percentage or relative frequency is on the Y-axis. It is also possible to find an equation for these simulation cures using basic probability. Try to plot the theoretical curer on the same graph as the experimental curve. They should match pretty closely. make sure to label the graphs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
