#include<iostream>
#include<stdlib.h>
#include<time.h>
#include<iomanip>
#include<math.h>
using namespace std;
int main(){
srand(time(NULL));
cout << "Enter number of times to generate 2
points:";
int n;
cin >> n;
double sum = 0;
for (int i = 0; i<n; i++){
double x1 = ((double)rand() /
(RAND_MAX));
double y1 = ((double)rand() /
(RAND_MAX));
double x2 = ((double)rand() /
(RAND_MAX));
double y2 = ((double)rand() /
(RAND_MAX));
double d = sqrt((x1-x2)*(x1-x2) +
(y1-y2)*(y1-y2));
sum = sum + d;
}
cout << "The average distance is " <<
fixed << setprecision(2) << sum/(double)n <<
endl;
}

points are chosen Uniformly at random within-/revnit sgua? tb esthmaste expectd (vema 1e ? .nu segment...
4. A random point (X, Y ) is chosen uniformly from within the unit disk in R2, {(x, y)|x2+y2< 1} (a) Let (R, O) denote the polar coordinates of the point (X,Y). Find the joint p.d.f. of R and . Compute the covariance between R and 0. Are R and e are independent? (b) Find E(XI{Y > 0}) and E(Y|{Y > 0}) (c) Compute the covariance between X and Y, Cov(X,Y). Are X and Y are independent?
4. A random...
Problem 3.4 (10 points) Consider this game of chance with a monetary payoff. First, a real number is chosen uniformly at random from the interval [0,10]. Next, an integer X is chosen according to the Poisson distribution with parameter U. The player receives a reward of SX What would be the fair price charged for playing this game? That is, how much should it cost to play so that expected net gain is zero?
Problem 3.4 (10 points) Consider this...