write a program in matlab to produce a discrete event simulation of a switching element with...

60.1K

Verified Solution

Question

Statistics

write a program in matlab to produce a discrete event simulationof a switching element with 10 inputs and 3 outputs. Time isslotted on all inputs and outputs. Each input packet follows aBernoulli process. In a given slot, the independent probabilitythat a packet arrives in a slot is p and the probability that aslot is empty is (1– p). One packet fills one slot. For a switchingelement if 3 or less packets arrives to some inputs, they areforwarded to the switching element outputs without a loss. If morethan 3 packets arrive to the inputs of the switching element, only3 packets are randomly chosen to be forwarded to the switchingelement outputs and the remaining ones are discarded. In yoursimulation the program will mimic the operation of the switch andcollect statistics. That is, in each time slot the program randomlygenerates packets for all inputs of the switching element andcounts how many packets can be passed to the output of theswitching element (causing throughput) and, alternatively countshow many packets are dropped (when the switching element has morethan 3 input packets at a given time slot) . Your task is tocollect throughput statistics for different values of p (p = 0.05,0.1 up to 1.0 in steps of 0.05), by running the procedure describedabove for each value of p and for many slots (at least a thousandslots per value of p). The more simulated slots, the more accuratethe results will be. Based on this statistics, plot two graphs: 1)the average number of busy outputs versus p, and 2) the averagenumber of dropped packets versus p.

Answer & Explanation Solved by verified expert
3.7 Ratings (562 Votes)
outputscode in text formatInclude the required header filesinclude include include includeusing namespace stdDefine the    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students