# Appendix a to applied probability: directory of m-functions and m  (Page 22/24)

 Page 22 / 24

## Compound demand

The following pattern provides a useful model in many situations. Consider

$D=\sum _{k=0}^{N}{Y}_{k}$

where ${Y}_{0}=0$ , and the class $\left\{{Y}_{k}:1\le k\right\}$ is iid, independent of the counting random variable N . One natural interpretation is to consider N to be the number of customers in a store and Y k the amount purchased by the k th customer. Then D is the total demand of the actual customers. Hence, we call D the compound demand .

gend.m Uses coefficients of the generating functions for N and Y to calculate, in the integer case, the marginal distribution for the compound demand D and the joint distribution for $\left\{N,D\right\}$ .

% GEND file gend.m Marginal and joint dbn for integer compound demand % Version of 5/21/97% Calculates marginal distribution for compound demand D % and joint distribution for {N,D} in the integer case% Do not forget zero coefficients for missing powers % in the generating functions for N, Ydisp('Do not forget zero coefficients for missing powers') gn = input('Enter gen fn COEFFICIENTS for gN ');gy = input('Enter gen fn COEFFICIENTS for gY '); n = length(gn) - 1; % Highest power in gNm = length(gy) - 1; % Highest power in gY P = zeros(n + 1,n*m + 1); % Base for generating Py = 1; % Initialization P(1,1) = gn(1); % First row of P (P(N=0) in the first position)for i = 1:n % Row by row determination of P y = conv(y,gy); % Successive powers of gyP(i+1,1:i*m+1) = y*gn(i+1); % Successive rows of P endPD = sum(P); % Probability for each possible value of D a = find(gn); % Location of nonzero N probabilitiesb = find(PD); % Location of nonzero D probabilities P = P(a,b); % Removal of zero rows and columnsP = rot90(P); % Orientation as on the plane N = 0:n;N = N(a); % N values with positive probabilites PN = gn(a); % Positive N probabilitiesY = 0:m; % All possible values of Y Y = Y(find(gy)); % Y values with positive probabilitiesPY = gy(find(gy)); % Positive Y proabilities D = 0:n*m; % All possible values of DPD = PD(b); % Positive D probabilities D = D(b); % D values with positive probabilitiesgD = [D; PD]'; % Display combinationdisp('Results are in N, PN, Y, PY, D, PD, P') disp('May use jcalc or jcalcf on N, D, P')disp('To view distribution for D, call for gD')

gendf.m function [d,pd] = gendf(gn,gy) is a function version of gend , which allows arbitrary naming of the variables. Calculates the distribution for D , but not the joint distribution for $\left\{N,D\right\}$ .

function [d,pd] = gendf(gn,gy)% GENDF [d,pd] = gendf(gN,gY) Function version of gend.m% Calculates marginal for D in the integer case % Version of 5/21/97% Do not forget zero coefficients for missing powers % in the generating functions for N, Yn = length(gn) - 1; % Highest power in gN m = length(gy) - 1; % Highest power in gYP = zeros(n + 1,n*m + 1); % Base for generating P y = 1; % InitializationP(1,1) = gn(1); % First row of P (P(N=0) in the first position) for i = 1:n % Row by row determination of Py = conv(y,gy); % Successive powers of gy P(i+1,1:i*m+1) = y*gn(i+1); % Successive rows of Pend PD = sum(P); % Probability for each possible value of DD = 0:n*m; % All possible values of D b = find(PD); % Location of nonzero D probabilitiesd = D(b); % D values with positive probabilities pd = PD(b); % Positive D probabilities

what are the important of economic to accounting students with references
Economics is important because it helps people understand how a variety of factors work with and against each other to control how resources such as labor and capital get used, and how inflation, supply, demand, interest rates and other factors determine how much you pay for goods and services.
explain the steps taken by the government in developing rural market?
contribution of Adam smith in economics
I will join
Dexter
I will join
Patrick
Hey
Fatima
Hey
Amir
Hello
AS
hey
Umarou
I love this book and i need extra Economic book
Amir
Hey
Amir
what's happening here
AS
I love this book and i need extra Economic book
Amir
what is the meaning of function in economics
Pls, I need more explanation on price Elasticity of Supply
Is the degree to the degree of responsiveness of a change in quantity supplied of goods to a change in price
Afran
Discuss the short-term and long-term balance positions of the firm in the monopoly market?
hey
Soumya
hi
Mitiku
how are you?
Mitiku
can you tell how can i economics honurs(BSC) in reputed college?
Soumya
through hard study and performing well than expected from you
Mitiku
what should i prepare for it?
Soumya
prepare first, in psychologically as well as potentially to sacrifice what's expected from you, when I say this I mean that you have to be ready, for every thing and to accept failure as a good and you need to change them to potential for achievement of ur goals
Mitiku
parna kya hai behencho?
Soumya
Hallo
Rabindranath
Hello, dear what's up?
Mitiku
cool
Momoh
good morning
Isaac
pls, is anyone here from Ghana?
Isaac
Afran
Afran
Hello
OLANIYI
pls anyone from Nigeria
OLANIYI
am a new candidate here, can someone put me 2ru
OLANIYI
hello
OLANIYI
Pls economic A level exam tomorrow pls help me
akinwale
am from Ghana
Jacob
hi
Charles
Pls economic A level exam tomorrow pls help me
akinwale
Hi
Dev
bol Diya discuss ab krega v
Dev
hello Mr. Rabindranath
Dev
what do you want Dimlare
Dev
yes tell me your desire to have it
Dev
to have what?
OLANIYI
Good luck
JOSEPH
I want to know about economic A level tomorrow pls help
Lerato
okay
Umarou
okay
Umarou
what is firms
A firm is a business entity which engages in the production of goods and aimed at making profit.
What is autarky in Economics.
what is choice
So how is the perfect competition different from others
what is choice
Tia
1
Naziru
what is the difference between short run and long run?
It just depends on how far you would like to run!!!🤣🤣🤣
Anna
meaning? You guys need not to be playing here; if you don't know a question, leave it for he that knows.
Ukpen
pls is question from which subject or which course
Is this not economics?
Ukpen
This place is meant to be for serious educational matters n not playing ground so pls let's make it a serious place.
Docky
Is there an economics expert here?
Docky
Okay and I was being serous
Anna
The short run is a period of time in which the quantity of at least one inputs is fixed...
Anna
that is the answer that I found online and in my text book
Anna
Elacisity
salihu
Meaning of economics
It will creates rooms for an effective demands.
different between production and supply
babsnof
Hii
Suraj
hlo
eshita
What is the economic?
Suraj
Economics is a science which study human behavior as a relationship between ends and scarce means which has an alternative use.
Mr
what is supply
babsnof
what is different between demand and supply
Demand refers to the quantity of products that consumers are willing to purchase at various prices per time while Supply has to do with the quantity of products suppliers are willing to supply at various prices per time. find the difference in between
Saye
Please what are the effects of rationing Effect of black market Effects of hoarding
A fair die is tossed 180 times. Find the probability P that the face 6 will appear between 29 and 32 times inclusive