Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

‫بسم هللا الرحمن الرحيم‬

University of Benghazi
Faculty of Engineering
Electrical and Electronic Engineering Department

.TELECOMMUNICATION LAB II
EE 496

Experment 1
Probability & Random Variable
.In MATLAB

‫ مروان الناجي الخليفة‬:‫االسم الطالب‬


26225 :‫الرقم الدراسي‬
‫ حنان الدغاري‬:‫أستاذة المادة‬

:Experiment list
.PC & Matlab software

:Objective
Introduction to probability & random variable using MATLAB
.software

:Procedure
:part 1
density & distribution function visualization using bult-in
MATLAB commands

)continuous case: a
i- represesnt in MATLAB the following density
:function
:Uniform(a,b) -1
1
f (x=) ,a≤ x≤ b
b− a

1 1
f (x=) = − , 1≤ x≤ 1
( 1) 2
1− −

:Measured
E X( =) 0∧rav X( =5.0
)

:Theoretical
b+ a 1− 1
E X( =) = =0
2 2
2 2
b(− a ) 1[− −( 1 ) ] 1
rav X
( =) = = 3333.
=0
21 21 3

5.0
3333.0

RE rav %= 0∗01 =05 %
3333.0
(X )

1
σ= rav
√ (X =

) 775.0
3
=

:Gaussian (Normal)(μ,σ) -2
2
− (x− μ )
1 2σ
2

f (x=) e , ≤ x≤∞
−∞
σ √2π
−1 2
1 2
x
f (x=) e , 3≤ x≤ 3

√2π

:The peak value of the normal pdf at x=μ


1 1
f (x=) = 9893.0
=
σ√2π √2π

:exponential(λ) -3
f (x=) λ e−xλ ,x≥ 0

f (x=) e− x ,0 ≤ x≤01

:Measured
E X( =) 1rav
, X
( =) 1

:Theoretical
1 1
E X( =) = = 1
λ 1

1 1
rav X
( =) = =1
λ2 1

σ= rav
√ ) 1
(X =

ii- Represent by graphs the density function using different


:distribution parameters

:Normal -1
• :Different means but same standard deviation
Consider three normal distributions with constant
standart deviation (σ=1) & three different means (μ=
.-2,0,2)

• :Same mean but different standard deviation

Consider three normal distributions with constant mean (μ=0)


.& three different standard deviation (σ=0.1,0.5,1)
:Exponential -2

.Consider three exponential distributions with (λ=0.5,1,1.5)


:b) Discrete case

:Represent in MATLAB the following mass function

:Bernoulli(1,p) -1

p k( =) 1 p kq 1− k ,k=1,0
()
k

p k( =) 15.0 5.0
k 1− k
()
k
,k=1,0 …9,.
,

f 0( =5.0
) ∧ f 1( =5.0
)

:Measured
μ=
k5.0 rav
, K( =5.0
)

:Theoretical
μ=
k p=
5.0 rav K( =qp
) 52.0
=
5.0 52.0

RE rav %=
(K ) 0∗01 =
001 %
5.0

σ= rav
√ (K =
)52.0
√ =5.0

:Binomial(n,p) -2

p k( =) n p kq n− k ,k=1,0 …
k () , ,n

p k( =) 02 5.0 5.0
k 02 − k
( )
k
,k=1,0 …
, . ,n− 1

:Measured
μ =01
k rav
, 2671.0
K( =)

:Theoretical
μ =pn
k = 02( 5.0
)( =01
)
rav K( =
qpn
) = 02( 5.0
) ( 5.0
) ( =) 5

2671.0 −5
RE rav %=
(K ) 0∗01 =−
84.69 %
5

σ= rav
√ (K =
) √632.2
5=

:Poisson(λ) -3

e− λλ k
p k=
( ) ,k=1,0 …
, …… .
k!

e− 11 k
p k( =) ,k=1,0 …
, ,n− 1
k!

:Measured
μ=
k5.0 rav
, 9763.0
K( =)

:Theoretical
μ=
krav K( =) λ= 1
5.0 − 1
RE %=
μ 0∗01 =−05 %
1

9763.0 −1
RE rav %=
(K ) 0∗01 =−
12.36 %
1

σ= rav
√ (K =
) 1

:part 2
:probability distribution function user interface (disttool)

The interface opens with a plot of the cdf of normal


.distribution

select PDF from the Function type drop-down menu to plot the
pdf of the normal distribution using the same parameter
.values
.Change the value of the location parameter μ to 1

As the parameter values changes, the shape of the plot also


change. Also, the value of X remains the same, but the density
.value changes because the parameter is changes

Use the Distribution drop-down menu to change the


distribution type from normal to Weibull
The shape of the plot changes, along with the names & values
.of the parameter

:Part 3
:Generation of frequently used probability models

Case 1: Normal

N=100
N=10,000
Case 2: Exponential

N=100

N=10,000
:Part 4
:Statistecal average of random variables

Calculate the sample mean, stantard deviation & variance for


.the random numbers generated in part 3

:In a normal
2
μ= 0 ,σ= 1∧ σ = 1

:In an exponential
1 2 1
μ= = 1 ,σ = = 1∧ σ= 1
λ λ2

:Conclusion
in an uniform distribution, the axis horizontal confined •
between -1 & 1 is represent rectangular and the density
.function is equal to 0.5, the area between -1 & 1 is equal to 1

in a normal distribution, the normal is a bell-shaped, the curve •


shape is a stantard normal because the mean is 0 & std is 1, the
normal curve is no touches the axis horizontal. the mean
,median & mode are equal. The area between -3 & 3 is
approximatly to 0.9973. the normal shape is symmetry about
the center 50% of values less than the mean & 50% greater
.than the mean

in an exponential, the area between 0 & 10 is approximatly to •


.0.99995

in a bernoulli distribution, the number times a trial is 1, if k=1 •


we get the probability success & if k=0 we get the probability
failure. There are two samples of the bernoulli but the same
.value

in a binomial distribution, the number of times a trial is 20, we •


see that the probability success & failure are symmetric,
because the probability success & failure are the same value is
.0.5, we get the normal distribution

in a poisson distribution, the figure shape is approximate to •


exponential. when lambda is small, then the shape is twisting
to the right, and but if the lambda is increase, the shape is
.approximates to normal

fix std & change mean, if the look the shape normal, here •
changes the place distribution of the mean (uses the shift) but
.no changes the shape distribution
fix mean & change std, if the look the shape normal, here •
changes the shape distribution of the std. The lower std,
decrease the distribution but the approaches mean & the
.higher std, increase the distribution but the away mean

change lambda, if the look a shape, when lambda is small, the •


initial value of the PDF is small, But then decays pretty slow.
When lambda is large, then the PDF starts large, but then it
.decays pretty fast

in a part 3, the number of N samples is 100, but not the •


accurate in a normal & exponential, increases the number of N
.samples, the more accurate it is a normal & exponential

You might also like