Question
You can use this example:
X= number of total active users out of number of total users.
Y=number of total users
Y=D1*625 and D1 can take integer values 1,2,3,4,5,6,7,8,9,10. For example, the maximum total users is 625*10. The maximum number will change with the distribution type and probability. For constant case, we can take Y=6250 when probability(p) is equal to 1, but if it is binomial and the probability is equal to 0.1 then Y=625*2, if it is 0.2 then Y=2*625.
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
% Assume Y_max=6250Y_max=100;%6250;
% Assume Y has a binomial distribution with parameter Y_max, p1=.1;
p1=.1;
% Assume X|Y has a binomial distribution with parameter Y, and p2=.2;
p2=.2;
%distribution of X f(x)=sum_y f(x|y)f(y)
f_X=zeros(Y_max+1,1);
f_XY=zeros(Y_max+1,Y_max+1);
for y=0:Y_max
p_y=binopdf(y,Y_max,p1);
for x=0:y
f_XY(x+1,y+1)=binopdf(x,y,p2)*p_y;...