# Specify the software/langauge | Computer Science homework help

Problem 1 Continuous-Time Information Streams (a) Generate a stream of i.i.d. random variables U = {Un, 1 ::::; n ::::; N} which are uniformly distributed over [0, 1], for N = 1000,5000, 10000. (i) Use the resulting streams to draw probability distribution histograms which show the probabilities that U is in the interval (0.1i, 0.1i + 0.1], for i = 0, 1, … , 9. Also, compare it with the analytically derived values of the uniform distribution probabilities, for N = 1000, 5000, 10000. (ii) Compute the sample means and variances, for each of the three runs. Then, compare the results with the computed means and variances. * Note: when the variable {Xn, 1 ::::; n ::::; N} are observed, N > 1, the sample mean J-lN and sample variance a’fv are given by (b) Generate a stream of i.i.d. random variables T = {Tn , 1 ::::; n ::::; N} which are exponentially distributed with parameter (intensity) A = 0.1 for N = 1000,5000,10000. (i) Use the resulting streams to draw probability distribution histograms which show the probabilities that Tis in the interval (i, 1 +i], fori= 0, 1, … , 19. Also, compare it with the analytically derived values of the exponentially distribution probabilities, for N = 1000,5000, 10000. (ii) Compute t he sample means and variances, for each of the three runs. Then, compare the results with the computed means and variances. The random variable Tn is governed by the distribution where U(t) is the unit step function. Note that the mean and variance of Tn are equal to ± and }2 , respectively. (iii) Show that if Un is uniformly distributed over (0, 1], then the random variable T defined by the transformation 1 T = –ln(Un) A is exponentially distributed with parameter A and mean ±. (c) Consider a traffic stream represented by the stochastic point process A = {An, n 2:: 0} , Ao = 0, where An denotes the time of the occurrence of the nth message arrival. The nth inter-arrival time is 1 Clearly, we have Assume the inter-arrival time sequence T = {Tn, 1 ~ n} to consist of i.i.d. exponentially distributed random variables with parameter A ( and mean t)· Then the traffic stream A is said to be a Poisson point process. Use (b) to generate a sequence T = {Tn, 1 ~ n ~ N} consisting of i.i.d. exponentially distributed random variables with A = 0.1, for N = 1000,5000, 10000. Then, generate and plot a Poisson point process stream A= {An, n 2: 0}, A0 = 0, for N = 1000,5000,10000. (d) Let N(t) be the counting variable associated with the point process A, so that N ( t) represents the number of arrivals (events) occurring during the interval (0, t], with N(O) = 0. The process N = {N(t), t .2: 0} is the associated counting process. We have N(t) = max{n: An~ t < An+l}· Consider a Poisson point process A with intensity A. The associated counting process N is then called a Poisson Counting Process. For this process, we note the following properties: (P1) N(t) follows a Poisson distribution: e->.t(At)n P(N(t)=n)= 1 ,:fn=0,1, … , n. E[N(t)] =At; Var[N(t)] =At. (P2) The probability of an event occurrence in an interval (t, t + h] of small duration h (so that Ah << 1) is approximately equal to Ah: P(N(t +h)- N(t) = 1) = Ah + o(h), P(N(t +h)- N(t) = 0) = 1- Ah + o(h), h l . <&D_ 0 w ere 1mh->O h = . (P3) The number of events occurring over an interval is statistically independent of the number of events occurring over any other disjoint interval. (i) Write a computer program that generates and plot a realization of a Poisson counting process N, starting with your generated Poisson point process A, for N = 1000,5000,10000. (ii) For A = 0.1, t = 30, generate the Poisson counting variable N(30). Generate M independent realizations of N(30), and use the results to draw the probability distribution histogram expressing P(N(30) = n), n 2: 0, and to compute the mean and variance of N(30) for M = 500, 1000, 1500, respectively. Compare these results with the analytically derived values of the distribution probabilities and the mean and variance. 2 (iii) For A = 0.1 , h = 1, verify the above mentioned property (P2) , for N = 1000,5000,10000. Problem 2 Discrete-time Information Streams (a) Generate a stream of i.i.d. discrete random variables T = {Tn , 1 ::::; n < N} which are Geometrically distributed with parameter p = 0.1, for N 1000,5000,10000. (i) Use the resulting streams to draw probability distribution histograms and compare it with the analytically derived values of the distribution probabilities, for N = 1000, 5000, 10000. The random variable Tn is governed by the distribution P(Tn = j) = (1- p)j- 1 p, Vj = 1, 2, …. (ii) Compute the sample means and variances, for each of the three runs. Then, compare the results with the computed means and variances (i.e., E[Tn] ‘:= ~ and Var[Tn] = -tp). (b) Consider a traffic stream represented by the stochastic point process A = {An, n 2: 0} , A0 = 0, where An denotes the time of the occurrence of the nth message arrival. The nth inter-arrival time Time is divided into slots. Assume each slot to be of unit length and slot mark times to be at 0, 1, 2, 3, .. .. Assume A to be a discrete time point process, so that events can occur only at discrete times 0, 1, 2, …. Assume the inter-arrival time sequence T = {Tn, n 2: 1} to consist of i.i.d. geometrically distributed random variables with parameter p, 0 < p ::::; 1. Then the traffic stream A is said to be a geometric point process. Use (1) to generate a sequence T = {Tn , 1 :S n :S N} consisting of i.i.d. Geometrically distributed random variables with parameter p = 0.1, N = 1000. (i) Generate and plot a geometric point process stream A = {An , n 2: 0} , where A0 = 0, for N = 1000,5000, 10000. (ii) Prove that for this point process the average number of occurrences in a slot is equal to the probability of an arrival at a slot. (c) Let N ( k) be the counting variable associated with the discrete time point process A, so that N ( k) represents the number of arrivals occurring during the first k slots, with N(O) = 0. The process N = {N(k) ,k = 0, 1, 2, . .. } is the associated counting process. 3 Consider a geometric point process A with intensity p (occurrences/slot). The associated counting process N is then called a Binomial counting process. The counting variable N(k) follows a binomial distribution: P(N(k) = n) = (~)pn(1- p)k- n, Vn = 0, 1, … , k, E[N(k)] = kp; Var[N(k)] = kp(1- p). (i) Write a computer program that generates and plots a realization of a Binomial counting process N, starting with your generated geometric point process A, for N = 1000, 5000, 10000. (ii) For p = 0.1, k = 30, generate the binomial counting variable N(30). Generate M independent realizations of N(30), and use the results to draw the probability distribution histogram expressing { P(N(30) = n), n 2’: 0} and to computer the mean and variance of N(30), for M = 500, 1000, 1500, respectively. Compare these results with the analytically derived values of the corresponding probabilities and of the mean and variance levels. (Draw the analytically computed values of the distribution probabilities next to the simulated histogram results.) 4