Simulate the binary despatch document picturesque in Problem 2 ce 100000 epidemic pieces. Ce
each piece, principal right the alike accidental sum generator over to state whether the epidemic
piece is a 0 or a 1, then right the alike accidental sum generator to state whether the epidemic
piece is common appropriately or improperly. The program should output the chance that a 0 is common,
the chance that a 1 was epidemic attached that a 1 was common, and the chance of an untruth.
Submit a printout of your rule and the output of the program.
num = 10;
% Total extension must be even
numOfOne = num/2
% List of accidental locations with no repeating 0s and 1s
indexes = randperm(num)
% Starting with every zeros
io = zeros(1, num);
% Half of them in accidental locations, a 1
io(indexes(1:numOfOne)) = 1