Skip to content

Instantly share code, notes, and snippets.

@enijkamp
Created March 29, 2016 02:20
Show Gist options
  • Save enijkamp/e41936f6324e3461ea06 to your computer and use it in GitHub Desktop.
Save enijkamp/e41936f6324e3461ea06 to your computer and use it in GitHub Desktop.
First, given the PDF we determine the corresponding CDF. While the following notation is mathematically not entirely correct, it simplifies the illustraion:
f1(x) = x/144 if 0 < x < 12
f2(x) = (24-x)/144 if 12 < x < 24
F1(x) = x^2/288 + c if 0 < x < 12
F2(x) = x/6-x^2/288 + c if 12 < x < 24
Next, we find the probabilities that:
a) X is between 1 and 10
P(1 < X < 10) = F1(10) - F1(1) = 10^2/288 - 1^2/288 = 11/32 ~= 0.34
b) X is between 11 and 16
P(11 < X < 16) = [F2(16) - F2(12)] + [F1(12) - F1(11)] = [(16/6-16^2/288) - (12/6-12^2/288)] + [(12^2/288) - (11^2/288)] = 103/288 ~= 0.36
c) X is less than 15
P(X < 15) = [F2(15) - F2(12)] + [F1(12) - F1(0)] = [(15/6-15^2/288) - (12/6-12^2/288)] + [(12^2/288) - (0^2/288)] = 23/33 ~= 0.72
d) X is greater than 10
P(X > 10) = 1 - P(X < 10) = 1 - F1(10) = 1 - [10^2/288] = 47/72 = 0.65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment