You are on page 1of 6

Department of Applied Physics, Electronics &Communication Engineering Course Title: Radio & Television Engineering Course Code: APECE-302

Submitted by: Sumona Islam Roll:RK-43 Nowrin Akter Surovi Roll:RK-16 Most. Nilufa Yeasmin Roll:RK-31 Khadiza Tahira Roll:RK-52 Homework description: Generating two random variables for the following cases: 1. No correlation between these two RVs. 2. Desired correlation between them. 3. Perfect correlation between them.

Random Variable:A Random Variable is a function, which assigns unique
numerical values to all possible outcomes of a random experiment under fixed conditions. A random variable is not a variable but rather a function that maps events to numbers. Suppose that a coin is tossed three times and the sequence of heads and tails is noted.The sample space for this experiment evaluates to: S={HHH, HHT, HTH, HTT, THH, THT,TTH, TTT}. Now let the random variable X be the number of heads in three coin tosses. X assigns each outcome in S a number from the set.Then Sx={0, 1, 2,3}. The list below lists the eight outcomes of S and the corresponding values of X.


HHH 3 HHT 2 HTH 2 THH 2 HTT 1 THT 1 TTH 1 TTT 0 X is then a random variable taking on values in the set Sx = {0, 1, 2, 3}.

Types Of R.V.: There are three types of random variables:

1.A Continuous Random Variable is one that takes an infinite number of possible values. Example: Duration of a call in a telephone exchange. 2.A Discrete Random Variable is one that takes a finite distinct values. Example: A number of students who fail a test. 3.A Mixed Random Variable is one for which some of its values are continuous and some are discrete.

Correlation is a statistical measurement of the extent of the linear relationship between two variables. Possible correlations range from +1 to 1. A zero correlation indicates that there is no relationship between the variables. A correlation of 1 indicates a perfect negative correlation, meaning that as one variable goes up, the other goes down. A correlation of +1 indicates a perfect positive correlation, meaning that both variables move in the same direction together.

Calculation Of Correlation: Correlation Coefficient:

The formula used in the calculation involves six different values obtained from the X and Y variables 1.The first two values are simply the sum of X values and Y values 2.The Greek letter (pronounced sigma) is used to represent the summations. 3.The next step involves squaring each of the X and Y values;and summing them. 4.In the next step, the product of each pair of X and Y scores is obtained;and summed. 5.The last of the preliminary steps is to simply determine the number of stuff beingincluded in the calculations. In summary, our six values used to calculate the correlation coefficient aren,X,Y,X^2,Y^2,XY and the formula is

Where r is the correlation coefficient in (X,Y).We can consider 3 cases for the value of it. 1.If r=0,then the random variables are said to be uncorrelated. Clearly, independent random variables are said to be uncorrelated. 2.If the value of r remains between 0 and 1,then we can get a desired correlation which is neither perfect nor uncorrelated. 3.If r=1,then the random variables are said to be perfect correlated.

Generating random variables:

We can generate realizations of a continuous random vector (X, Y) using the relationship Fx,y(X,Y)=Fy|x(Y|X)Fx(X) (Of course, if X and Y are independent, we can generate X based on Fx(x) and Y based on Fy(y)). Consider as an example the standard bivariate Gaussian PDF. We know that Y|(X=x)~N(x,1-^2) and X~N(0,1) Hence, we can generate realizations of (X,Y) as follows. Step 1: Generate X = x according to N(0,1). Step 2: Generate Y|(X=x) according to N(x,1-^2). If we let x=y=0, x^2=y^2=1 then we have

Where U~N(0,1) ,V~N(0,1) and U and V are independent. The transformation can be used to generate realizations of a standard bivariate Gaussian random vector.

Programs Using Matlab:

Generate two random variable with no correlation u=rand(1,100); v=rand(1,100); rho=0; x=u; y=(rho*u+sqrt(1-rho^2)*v); plot(x,y,'.') The figure is given below,


Generate two random variable with correlation coefficient =.9 u=rand(1,100); v=rand(1,100); rho=.9; x=u; y=(rho*u+sqrt(1-rho^2)*v); plot(x,y,'.') The figure is shown below,


Generate random variable with perfect correlation, u=rand(1,100); v=rand(1,100); rho=1; x=u; y=(rho*u+sqrt(1-rho^2)*v); plot(x,y,'.') The figure is given below,