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.