A real number X is drawn at random from the interval (0,1). A rectangle is formed with sides X and (1-X). Denote the area by Y = X*(1-X).
(a). Write an R function that returns a sample of size n on Y. Print out a sample of size 20.
(b). Estimate the expected value (mean) of Y based on a sample of size 10,000.