#1.) ?rivers

hist(rivers)

summary(rivers); data(rivers); long_rivers = rivers[rivers > 1000]; print(long_rivers);

b) mean = 591.1844 miles. standard deviation = 493.8708.

d) min = 135. 1st quarter = 310. median = 425 miles. mean = 591.2. 3rd quarter = 680 miles. Max = 3710 miles

e) min = 135 miles. max = 3710 miles

f) 1459, 1450, 1243, 2348, 1171, 3710, 2315, 2533, 1306, 1054, 1270, 1885, 1100, 1205, 1038, 1770

#2.) ?airquality # a) 153 observations on 6 variables # b) nuemeric Ozone, numeric solar R, numeric wind, numeric temperature, numeric month, numeric day of month # c) quantitive data # d) I agree with some but not all. There should be a percentage of carbon dioxide and fossil fuels recorded for air quality.

#3.) yellow = 0.14; red = 0.13; orange = 0.2; brown = 0.12; green = 0.2; blue = 0.21;

p_not_green = 1-green; p_red_orange_yellow = red + orange + yellow; out_of_four = 1-blue^4; all_six = 6!/(6^6);

#4.) # a) n = 7 k = 3 p = 0.5 probability = dbinom(k, n, p); print(probability);

#5.) # a) value = c(0, 1, 2, 3); probabilities = c(1/4, 1/2, 1/8, 1/8); sample_size = 10000 sample_X = sample(values, sample_size, replace = TRUE, prob = probabilities) estimate = sum(sample_x == 1) / sample_size; print(estimate);

b)

table_X = table(sample_x); pmf_estimate = table(sample_x); pmf_estimate = table_x / sample_size; print(pmf_estimate);