Consider the following two experiments: the first has outcome X taking on the values 0, 1, and 2 with equal probabilities; the second results in an (independent) outcome Y taking on the value 3 with probability 1/4 and 4 with probability 3/4. Find the distribution of:
#create X as per the dist specified
X<-runif(100000)
X[X >=0.66] = 1
X[X < 0.33] = 2
X[X < 1 ] = 0
#create Y as specified
Y<-runif(100000)
Y[Y >0.25] = 3
Y[Y != 3] = 4
#plot to do a visual check that the distribution of X and Y are approx correct...
hist(X,freq=F,breaks=seq(0,2,l=4))Answer: The distribution of \(Y+X\) is shown above.