Question: Use the matlab code provided below to solve the following problems: Matlab code: close all; clear all; clc; N=10; P=0.22; % Chose parameters here narrayneg=[-2:N];

Use the matlab code provided below to solve the following problems:

Use the matlab code provided below to solve the following problems: Matlab

Matlab code:

close all; clear all; clc; N=10; P=0.22; % Chose parameters here narrayneg=[-2:N]; % Choose a horizontal axis of integers naneg_fine=[-2:0.01:N]; % Choose a horizontal axis, finely spaced narrayzero=[0:N];

Z=binopdf(narrayneg,N,P); figure; stem(narrayneg,Z); grid title('PMF of a Binomial Random Variable'); [narrayneg' Z']

Z0=binopdf(narrayzero,N,P); Zlog = log10(Z0);

Y=binocdf(naneg_fine,N,P); figure; plot(naneg_fine,Y); grid title('CDF of a Binomial Random Variable');

M=10000; X = random('bino',N,P,1,M); figure; plot(X); title(' Plot of data values from a Binomial RV with M=10000'); grid

figure; hist(X,(N*10+1)); grid title(' Histogram obtained from simulated Binomial RV values with M=10000')

Use the Matlab script RV X with: N-10; P-0.22 (corresponding to n-10 and p-0.22 using the textbook notation): that produces the PMF and CDF of a binomial a) Modify the code to use N-8: P 0.35 then add a few statements to check if all values of the PMF add to b) Rename and modify the script to remove the plotting and then add statements to compute the probabilities (using the CDF and/or the PMF) of the following events involving the RV X: 3- P X 2 or X 6) 4- PfX>4.99999)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!