EE315 Probability in Electrical Engineering (151) Project

EE315 Probability in Electrical Engineering (151)
Project Assignments
Electrical Engineering Department, University of Hail
Semester 151 – 2015/16(1)
Instructor: Dr. Mohamed Abdul Haleem
Due: December 10, 2015
Carefully identify the project assigned to you. Each student should submit a separate
report. Students assigned to the same project may collaborate in completing the project but
not required to do so. Program the computer using OCTAVE or MATLAB environment
to obtain for the results. Write a comprehensive report including any relevant formulations,
program listing, tables and plots. Plots should be clearly labeled. Choose different colors,
line types, and thicknesses to distinguish multiple plots. Legends should be included.
MATLAB and Octave software have a function called rand() to generate random numbers
with uniform distribution. In most of the projects listed below, you will first generate a sequence
of random numbers ui i=1,2,…,N using a uniform probability distribution in (0,1). Then this
sequence of random numbers will be used to generate random numbers with another probability
distribution as described in each project. You may also use functions such as hist()and
xor()among many others in the program. Note that in MATLAB natural logarithm ln is
log()and logarithm to the base 10 is log10()
List of Projects
Project 1: (OMAR ABDELWAHAB ABDULKAREEM AL-BDRAN, Nawaf Rowaished Ali) Write a program
to generate a sequence of random numbers that correspond to Rayleigh distribution given by
2
1 − e −( x − a ) / b x ≥ a
1/ 2
FX ( x ) = 
. Use the transformation xi = a +  −b ln (1 − ui ) 
to generate
x<0
0
random numbers xi with Rayleigh distribution. Here ui i=1,2,…,N is a sequence of random
numbers from a random variable U with uniform probability distribution in (0,1). In your report
explain how this transformation produces the required random variable model. Plot the
histogram of relative frequency of ui and pdf of uniform random variable U in one figure.
Generate another figure and plot the histogram of xi and Rayleigh pdf. You may set a = 0, b = 1.0
Then repeat the computation for one more set of values of a and b. Experiment with different
values for N. It should be in the range of 100~10000. Read Example 3.5-3 on pp. 94-96 of the
textbook for clues.
Project 2: (Mshari Marji Hommud Alharbi, Sami Mzael Rade Alshamry) Write a program to generate
a sequence of random numbers that correspond to an exponential distribution given by
 1 − e−( x − a ) / b x ≥ a
. Use the transformation xi =  a − b ln (1 − ui )  to generate random
FX ( x ) = 
x<0
0
numbers xi with exponential distribution. Here ui i=1,2,…,N is a sequence of random numbers
1|Page
from a random variable U with a uniform probability distribution in (0,1). In your report explain
how this transformation produces the required random variable model. Plot the histogram of
relative frequency of ui and pdf of uniform random variable U in one figure. Generate another
figure and plot the histogram of xi and true exponential pdf. You may set a=0, b=1.0 for the first
test. Then repeat one more set of values for a and b. Experiment with different values for N. It
should be in the range of 100~10000. Read Example 3.5-3 on pp. 94-96 of the textbook for
clues.
Project 3: (Saad Mohammed Saad Aljurbue, Abdullah Lafi Mazyad) If U1 and U2 are random
variables both uniformly distributed in (0,1), then a Normal random variable can be obtained by
cos 2
. Prove this result. Write a program to generate
the transformation = −2 ln
two (independent) sequences of random numbers u1i, u2i, i=1,2,…,N according to uniform
probability distribution in (0,1). Then use these sequences in the above transformation to
generate a sequence of random numbers yi according to normal distribution. In your report show
the derivation of this transformation. Plot the histograms for relative frequencies of u1i, u2i and
pdf of uniform random variable U1 or U2 in one figure. Generate another figure and plot the
histogram for relative frequency of yi and normal pdf. Experiment with different values for N. It
should be in the range of 100~10000. Read Example 3.5-3 on pp. 94-96 of the textbook for
clues.
Project 4: (Rakan Rashed Abdullah AL-khlil, Mohammed Saud Saad Al-Shammari) If W1 and W2 are
two Gaussian random variables then the transformation =
+
produces a random
variable with Rayleigh distribution. Use the MATLAB or OCTAVE function randn() to
generate two sequences of random numbers w1i, w2i, i = 1,2,…,N with normal distribution. Then
use the above transformation to generate a sequence of random numbers ri, i = 1,2,…,N with
Rayleigh probability distribution (What are the values of a and b of the Rayleigh pdf in this
case?). In your report show the derivation of the transformation. Plot the histograms for relative
frequencies of w1i, w2i and pdf of normal random variable W1 and W2 in one figure. Generate
another figure and plot the histogram for relative frequency of ri and true normal pdf.
Experiment with different values for N. It should be in the range of 100~10000. Read Example
3.5-3 on pp. 94-96 of the textbook for clues.
Project 5: (Ali Zamil Fhd Alglood, ABDULAZIZ Suliman ALTORAIFII) If W1 and W2 are two Gaussian
random variables then the transformation = tan
/
produces a random variable with
uniform distribution (What is the range of θ ?). Use MATLAB or OCTAVE function randn to
generate two sequences of random numbers w1i, w2i, i = 1,2,…,N with normal distribution. Then
use the above transformation to generate a sequence of random numbers θi, i = 1,2,…,N with
uniform probability distribution. In your report show the derivation of the transformation. Plot
the histograms for relative frequencies of w1i, w2i and pdf of normal random variables W1 and
W2 in one figure. Generate another figure and plot the histogram for relative frequency of ri and
true uniform pdf. Experiment with different values for N. It should be in the range of 100~10000.
Read Example 3.5-3 on pp. 94-96 of the textbook for clues.
Project 6: (Thamir Abdullah Buthaiyan Alammri, Abduljabbar Abdulsalam Hussein Abdullah)
Simulation of binary symmetric channel. Review Example 1.4-2 on pages 18-20 of the textbook.
2|Page
Write a program to simulate binary symmetric channel as described in this example. The
procedure is as follows.
1. Transmitted binary messages: Generate a sequence of N binary numbers 1 and 0 with
probabilities P(B1) = P(1) = p and P(B2) = P(0) = 1-p. You may select p =0.6. Choose N
in the range of 1000~10000. This can be achieved by generating a sequence of random
numbers ui, i=1,2,…,N uniformly distributed in (0,1) by using the function x=rand(1,N)
and then using the function x = x < p. Here x represents the transmitted sequence of
binary messages.
2. Effect of channel: Generate another sequence of N binary numbers 0 and 1 with
probabilities P(A1 | B1) = P(A2 | B2) = q and P(A1 | B2) = P(A2 | B1) = 1- q. You may
select q =0.9. This can be achieved by generating a sequence of random numbers ci,
i=1,2,…,N uniformly distributed in (0,1) by using the function c = rand(1,N) and then
using the function c = c > q.
3. Received binary messages: A value of ci =1 means the channel will change the
transmitted message xi from 0 to 1 and vice versa. This effect can be programmed using
the function y=xor(x,c); (exclusive or operation)
4. Total error probability: Compare received messages y with transmitted messages x.
Use e=xor(x,y) to generate the sequence of error. This function will set ei = 1 if yi ≠ xi
and ei=0 otherwise. The expression Pe=sum(e)/length(e) can be used to compute the
relative frequency of an erroneous reception of a transmitted binary bit. This is
approximately equal to the probability of a received message is in error.
5. Plotting Pe versus q: Rerun the program for q=0, 0.1, 0.2…1. Tabulate q and Pe and
plot Pe versus q.
Project 7: (Rami Zaid Saleh Yehya, Faisal Yahya Mohammed Almosawi) Read Example 5.6-1 on pp.
161-162. In this example, sequences of random numbers are generated with Gaussian probability
distribution. Then the statistical parameters are computed for the generated samples and
compared with true values. Write the program as described and reproduce the results.
Project 8: (Mohammed Alshek Mohammed Othman, Rasheed Muhammad Marzoq Almekhalefe) Read
Example 5.7-3 on pp. 166-167. In this example a sequence of random numbers are generated
according to the probability distribution given. Then various statistics are computed and
compared with true values. Write the program as described and reproduce the results.
Project 9: (Hatim Abdullah Mudhhi Alshammari, Saleh Abdulrahman Alwaked) In this project you
will simulate a Poisson random process. Telephone call arrival at an exchange is an example of
such processes. It is known that inter-arrival time of Poisson process with mean arrival rate of λ
is exponentially distributed with parameter λ. Thus the cdf of inter-arrival time is
1 − e − λt t ≥ 0
FT (t ) = 
Read Example 3.5-3 on pp. 94-96 of the textbook for clues on how to
t<0
0
.
generate a sequence of random numbers with exponential distribution. Plot the number of arrival
versus time (Poisson random process), histograms and pdfs of exponential and Poisson random
variables. Choose λ=3 / min.
3|Page