Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Random variables Christopher Croke University of Pennsylvania Math 115 Christopher Croke Calculus 115 Random Variables A random variable X is a function from the sample space to the real numbers. Christopher Croke Calculus 115 Random Variables A random variable X is a function from the sample space to the real numbers. Example: Flip a coin 10 times. Let X be the number of heads. Christopher Croke Calculus 115 Random Variables A random variable X is a function from the sample space to the real numbers. Example: Flip a coin 10 times. Let X be the number of heads. Sample Space = {(H, T , H, H, T ...), (H, H, T , ...)...} Christopher Croke Calculus 115 Random Variables A random variable X is a function from the sample space to the real numbers. Example: Flip a coin 10 times. Let X be the number of heads. Sample Space = {(H, T , H, H, T ...), (H, H, T , ...)...} X ( (H, H, T , T , T , H, H, H, T , H) ) = 6. Christopher Croke Calculus 115 Random Variables A random variable X is a function from the sample space to the real numbers. Example: Flip a coin 10 times. Let X be the number of heads. Sample Space = {(H, T , H, H, T ...), (H, H, T , ...)...} X ( (H, H, T , T , T , H, H, H, T , H) ) = 6. Example: Roll two dice. Let X = sum of the pips. Christopher Croke Calculus 115 Random Variables A random variable X is a function from the sample space to the real numbers. Example: Flip a coin 10 times. Let X be the number of heads. Sample Space = {(H, T , H, H, T ...), (H, H, T , ...)...} X ( (H, H, T , T , T , H, H, H, T , H) ) = 6. Example: Roll two dice. Let X = sum of the pips. Sample space = {(1, 1), (1, 2), (1, 3), ..., (6, 6)}. Christopher Croke Calculus 115 Random Variables A random variable X is a function from the sample space to the real numbers. Example: Flip a coin 10 times. Let X be the number of heads. Sample Space = {(H, T , H, H, T ...), (H, H, T , ...)...} X ( (H, H, T , T , T , H, H, H, T , H) ) = 6. Example: Roll two dice. Let X = sum of the pips. Sample space = {(1, 1), (1, 2), (1, 3), ..., (6, 6)}. X ( (3, 5) ) = 8. Christopher Croke Calculus 115 Random Variables A random variable X is a function from the sample space to the real numbers. Example: Flip a coin 10 times. Let X be the number of heads. Sample Space = {(H, T , H, H, T ...), (H, H, T , ...)...} X ( (H, H, T , T , T , H, H, H, T , H) ) = 6. Example: Roll two dice. Let X = sum of the pips. Sample space = {(1, 1), (1, 2), (1, 3), ..., (6, 6)}. X ( (3, 5) ) = 8. For an example of a continuous random variable: Example: Measure the height of people and record the result. Christopher Croke Calculus 115 Random Variables A random variable X is a function from the sample space to the real numbers. Example: Flip a coin 10 times. Let X be the number of heads. Sample Space = {(H, T , H, H, T ...), (H, H, T , ...)...} X ( (H, H, T , T , T , H, H, H, T , H) ) = 6. Example: Roll two dice. Let X = sum of the pips. Sample space = {(1, 1), (1, 2), (1, 3), ..., (6, 6)}. X ( (3, 5) ) = 8. For an example of a continuous random variable: Example: Measure the height of people and record the result. X = height in feet. Christopher Croke Calculus 115 Random Variables A random variable X is a function from the sample space to the real numbers. Example: Flip a coin 10 times. Let X be the number of heads. Sample Space = {(H, T , H, H, T ...), (H, H, T , ...)...} X ( (H, H, T , T , T , H, H, H, T , H) ) = 6. Example: Roll two dice. Let X = sum of the pips. Sample space = {(1, 1), (1, 2), (1, 3), ..., (6, 6)}. X ( (3, 5) ) = 8. For an example of a continuous random variable: Example: Measure the height of people and record the result. X = height in feet. Y = height in inches. Christopher Croke Calculus 115 Random Variables A random variable X is a function from the sample space to the real numbers. Example: Flip a coin 10 times. Let X be the number of heads. Sample Space = {(H, T , H, H, T ...), (H, H, T , ...)...} X ( (H, H, T , T , T , H, H, H, T , H) ) = 6. Example: Roll two dice. Let X = sum of the pips. Sample space = {(1, 1), (1, 2), (1, 3), ..., (6, 6)}. X ( (3, 5) ) = 8. For an example of a continuous random variable: Example: Measure the height of people and record the result. X = height in feet. Y = height in inches. These are different random variables. Christopher Croke Calculus 115 Random Variables A random variable X is a function from the sample space to the real numbers. Example: Flip a coin 10 times. Let X be the number of heads. Sample Space = {(H, T , H, H, T ...), (H, H, T , ...)...} X ( (H, H, T , T , T , H, H, H, T , H) ) = 6. Example: Roll two dice. Let X = sum of the pips. Sample space = {(1, 1), (1, 2), (1, 3), ..., (6, 6)}. X ( (3, 5) ) = 8. For an example of a continuous random variable: Example: Measure the height of people and record the result. X = height in feet. Y = height in inches. These are different random variables. We can say things like Y = 12X . Christopher Croke Calculus 115 Going back to the X of the first example. We can talk about Pr (X = 3). Christopher Croke Calculus 115 Going back to the X of the first example. We can talk about Pr (X = 3). This is the same as Pr (E ) where E is the event of getting 3 heads. Christopher Croke Calculus 115 Going back to the X of the first example. We can talk about Pr (X = 3). This is the same as Pr (E ) where E is the event of (10) getting 3 heads. The answer is 2310 . Christopher Croke Calculus 115 Going back to the X of the first example. We can talk about Pr (X = 3). This is the same as Pr (E ) where E is the event of (10) getting 3 heads. The answer is 2310 . Pr (X ≥ 2) is Pr (E ) where E is the event of at least two heads. Christopher Croke Calculus 115 Going back to the X of the first example. We can talk about Pr (X = 3). This is the same as Pr (E ) where E is the event of (10) getting 3 heads. The answer is 2310 . Pr (X ≥ 2) is Pr (E ) where E is the event of at least two heads. Pr (X ≥ 2) = 1 − Pr (X = 0) − Pr (X = 1) Christopher Croke Calculus 115 Going back to the X of the first example. We can talk about Pr (X = 3). This is the same as Pr (E ) where E is the event of (10) getting 3 heads. The answer is 2310 . Pr (X ≥ 2) is Pr (E ) where E is the event of at least two heads. Pr (X ≥ 2) = 1 − Pr (X = 0) − Pr (X = 1) = 1 − 2110 − 210 10 Christopher Croke Calculus 115 Going back to the X of the first example. We can talk about Pr (X = 3). This is the same as Pr (E ) where E is the event of (10) getting 3 heads. The answer is 2310 . Pr (X ≥ 2) is Pr (E ) where E is the event of at least two heads. Pr (X ≥ 2) = 1 − Pr (X = 0) − Pr (X = 1) = 1 − 2110 − 210 10 = 1013 1 − 211 = . 10 1024 Christopher Croke Calculus 115 Going back to the X of the first example. We can talk about Pr (X = 3). This is the same as Pr (E ) where E is the event of (10) getting 3 heads. The answer is 2310 . Pr (X ≥ 2) is Pr (E ) where E is the event of at least two heads. Pr (X ≥ 2) = 1 − Pr (X = 0) − Pr (X = 1) = 1 − 2110 − 210 10 = 1013 1 − 211 = . 10 1024 Let X be a discrete random variable, i.e. at most countably many values say {x1 , x2 , ...}. Christopher Croke Calculus 115 Going back to the X of the first example. We can talk about Pr (X = 3). This is the same as Pr (E ) where E is the event of (10) getting 3 heads. The answer is 2310 . Pr (X ≥ 2) is Pr (E ) where E is the event of at least two heads. Pr (X ≥ 2) = 1 − Pr (X = 0) − Pr (X = 1) = 1 − 2110 − 210 10 = 1013 1 − 211 = . 10 1024 Let X be a discrete random variable, i.e. at most countably many values say {x1 , x2 , ...}. The probability distribution for X is the function f (x) given by: f (x) = Pr (X = x). Christopher Croke Calculus 115 Going back to the X of the first example. We can talk about Pr (X = 3). This is the same as Pr (E ) where E is the event of (10) getting 3 heads. The answer is 2310 . Pr (X ≥ 2) is Pr (E ) where E is the event of at least two heads. Pr (X ≥ 2) = 1 − Pr (X = 0) − Pr (X = 1) = 1 − 2110 − 210 10 = 1013 1 − 211 = . 10 1024 Let X be a discrete random variable, i.e. at most countably many values say {x1 , x2 , ...}. The probability distribution for X is the function f (x) given by: f (x) = Pr (X = x). So f is defined on the range of X . Christopher Croke Calculus 115 Going back to the X of the first example. We can talk about Pr (X = 3). This is the same as Pr (E ) where E is the event of (10) getting 3 heads. The answer is 2310 . Pr (X ≥ 2) is Pr (E ) where E is the event of at least two heads. Pr (X ≥ 2) = 1 − Pr (X = 0) − Pr (X = 1) = 1 − 2110 − 210 10 = 1013 1 − 211 = . 10 1024 Let X be a discrete random variable, i.e. at most countably many values say {x1 , x2 , ...}. The probability distribution for X is the function f (x) given by: f (x) = Pr (X = x). So f is defined on the range of X . 0 ≤ f (xi ) ≤ 1. Christopher Croke Calculus 115 Going back to the X of the first example. We can talk about Pr (X = 3). This is the same as Pr (E ) where E is the event of (10) getting 3 heads. The answer is 2310 . Pr (X ≥ 2) is Pr (E ) where E is the event of at least two heads. Pr (X ≥ 2) = 1 − Pr (X = 0) − Pr (X = 1) = 1 − 2110 − 210 10 = 1013 1 − 211 = . 10 1024 Let X be a discrete random variable, i.e. at most countably many values say {x1 , x2 , ...}. The probability distribution for X is the function f (x) given by: f (x) = Pr (X = x). So f is defined on the range of X . 0 ≤ f (xi ) ≤ 1. Σi f (xi ) = 1. Christopher Croke Calculus 115 Binomial trials Problem: Let X be the number of heads that occur when a coin is flipped 6 times. a) Compute the probability distribution of X . Christopher Croke Calculus 115 Binomial trials Problem: Let X be the number of heads that occur when a coin is flipped 6 times. a) Compute the probability distribution of X . b) Compute the probability distribution of (X − 3)2 . Christopher Croke Calculus 115 Binomial trials Problem: Let X be the number of heads that occur when a coin is flipped 6 times. a) Compute the probability distribution of X . b) Compute the probability distribution of (X − 3)2 . Note that two different random variables can have the same probability distribution. For example in this problem consider Y = # tails. Christopher Croke Calculus 115 Binomial trials Problem: Let X be the number of heads that occur when a coin is flipped 6 times. a) Compute the probability distribution of X . b) Compute the probability distribution of (X − 3)2 . Note that two different random variables can have the same probability distribution. For example in this problem consider Y = # tails. Binomial trials refer to trials that have two possible outcomes and are repeated. Christopher Croke Calculus 115 Binomial trials Problem: Let X be the number of heads that occur when a coin is flipped 6 times. a) Compute the probability distribution of X . b) Compute the probability distribution of (X − 3)2 . Note that two different random variables can have the same probability distribution. For example in this problem consider Y = # tails. Binomial trials refer to trials that have two possible outcomes and are repeated. Head or Tails. Christopher Croke Calculus 115 Binomial trials Problem: Let X be the number of heads that occur when a coin is flipped 6 times. a) Compute the probability distribution of X . b) Compute the probability distribution of (X − 3)2 . Note that two different random variables can have the same probability distribution. For example in this problem consider Y = # tails. Binomial trials refer to trials that have two possible outcomes and are repeated. Head or Tails. Red or Black card. Christopher Croke Calculus 115 Binomial trials Problem: Let X be the number of heads that occur when a coin is flipped 6 times. a) Compute the probability distribution of X . b) Compute the probability distribution of (X − 3)2 . Note that two different random variables can have the same probability distribution. For example in this problem consider Y = # tails. Binomial trials refer to trials that have two possible outcomes and are repeated. Head or Tails. Red or Black card. Positive or negative in TB test. Christopher Croke Calculus 115 Binomial trials Problem: Let X be the number of heads that occur when a coin is flipped 6 times. a) Compute the probability distribution of X . b) Compute the probability distribution of (X − 3)2 . Note that two different random variables can have the same probability distribution. For example in this problem consider Y = # tails. Binomial trials refer to trials that have two possible outcomes and are repeated. Head or Tails. Red or Black card. Positive or negative in TB test. Good or Bad refrigerator. Christopher Croke Calculus 115 Binomial trials Usually use “success” or “failure” (you can pick either label for either case). p = Pr (success). Christopher Croke Calculus 115 Binomial trials Usually use “success” or “failure” (you can pick either label for either case). p = Pr (success). q = Pr (failure) = 1 − p. Christopher Croke Calculus 115 Binomial trials Usually use “success” or “failure” (you can pick either label for either case). p = Pr (success). q = Pr (failure) = 1 − p. The experiment is to repeat the trial n times and our random variable X is the number of successes. Christopher Croke Calculus 115 Binomial trials Usually use “success” or “failure” (you can pick either label for either case). p = Pr (success). q = Pr (failure) = 1 − p. The experiment is to repeat the trial n times and our random variable X is the number of successes. We have solved this before: n k n−k Pr (X = k) = p q k for k = 0, 1, ..., n. Christopher Croke Calculus 115 Binomial trials Usually use “success” or “failure” (you can pick either label for either case). p = Pr (success). q = Pr (failure) = 1 − p. The experiment is to repeat the trial n times and our random variable X is the number of successes. We have solved this before: n k n−k Pr (X = k) = p q k for k = 0, 1, ..., n. In this case we say X is a binomial random variable with parameters n and p. Christopher Croke Calculus 115 Binomial trials Usually use “success” or “failure” (you can pick either label for either case). p = Pr (success). q = Pr (failure) = 1 − p. The experiment is to repeat the trial n times and our random variable X is the number of successes. We have solved this before: n k n−k Pr (X = k) = p q k for k = 0, 1, ..., n. In this case we say X is a binomial random variable with parameters n and p. the terminology comes from the fact that; n k n−k n n (p + q) = Σi=0 p q . k Christopher Croke Calculus 115 Binomial trials problems Problem: A baseball player with a .300 batting average comes to bat four times in a game. Find: a) The probability that he gets 2 hits. Christopher Croke Calculus 115 Binomial trials problems Problem: A baseball player with a .300 batting average comes to bat four times in a game. Find: a) The probability that he gets 2 hits. b) The probability that he gets at least 3 hits. Christopher Croke Calculus 115 Binomial trials problems Problem: A baseball player with a .300 batting average comes to bat four times in a game. Find: a) The probability that he gets 2 hits. b) The probability that he gets at least 3 hits. Problem: Storage.com makes writeable DVDs. One percent of the disks are defective. a) What is the probability that a box of 100 disks has exactly 2 defective disks? Christopher Croke Calculus 115 Binomial trials problems Problem: A baseball player with a .300 batting average comes to bat four times in a game. Find: a) The probability that he gets 2 hits. b) The probability that he gets at least 3 hits. Problem: Storage.com makes writeable DVDs. One percent of the disks are defective. a) What is the probability that a box of 100 disks has exactly 2 defective disks? b) What is the probability that there are at least 2 defective disks in a box of 100? Christopher Croke Calculus 115 Binomial trials problems Problem: A baseball player with a .300 batting average comes to bat four times in a game. Find: a) The probability that he gets 2 hits. b) The probability that he gets at least 3 hits. Problem: Storage.com makes writeable DVDs. One percent of the disks are defective. a) What is the probability that a box of 100 disks has exactly 2 defective disks? b) What is the probability that there are at least 2 defective disks in a box of 100? Problem:: Approximately 20% of a mall’s customers are over 65 years old (we assume that they spread out evenly over the day). A new store wants to encourage seniors to become customers. It decides to give a gift certificate to the first 4 people over 65 to enter the mall. What is the probability that the 4th person over 65 is the 10th customer? Christopher Croke Calculus 115 Continuous random variables X is a continuous random variable if its values range over real numbers. Christopher Croke Calculus 115 Continuous random variables X is a continuous random variable if its values range over real numbers. Example: Pick a cell at random from a culture and let X be its age (a real number). Christopher Croke Calculus 115 Continuous random variables X is a continuous random variable if its values range over real numbers. Example: Pick a cell at random from a culture and let X be its age (a real number). Given a cell culture where cells divide in two every T days. Then the proportion of cells of age between a and b where 0 < a < b < T remains constant over time (after things have been going for a while). Christopher Croke Calculus 115 Continuous random variables X is a continuous random variable if its values range over real numbers. Example: Pick a cell at random from a culture and let X be its age (a real number). Given a cell culture where cells divide in two every T days. Then the proportion of cells of age between a and b where 0 < a < b < T remains constant over time (after things have been going for a while). It turns out (under ideal circumstances) that the proportion is just the area under f (x) = 2ke −kx from a to b where k = ln(2) T . Christopher Croke Calculus 115 Continuous random variables X is a continuous random variable if its values range over real numbers. Example: Pick a cell at random from a culture and let X be its age (a real number). Given a cell culture where cells divide in two every T days. Then the proportion of cells of age between a and b where 0 < a < b < T remains constant over time (after things have been going for a while). It turns out (under ideal circumstances) that the proportion is just the area under f (x) = 2ke −kx from a to b where k = ln(2) T . This means Z b Pr (a ≤ X ≤ b) = f (x)dx a Christopher Croke Calculus 115 Continuous random variables X is a continuous random variable if its values range over real numbers. Example: Pick a cell at random from a culture and let X be its age (a real number). Given a cell culture where cells divide in two every T days. Then the proportion of cells of age between a and b where 0 < a < b < T remains constant over time (after things have been going for a while). It turns out (under ideal circumstances) that the proportion is just the area under f (x) = 2ke −kx from a to b where k = ln(2) T . This means Z b Z b 2ke −kx = −2e −kb + 2e −ka . Pr (a ≤ X ≤ b) = f (x)dx = a a Christopher Croke Calculus 115 Continuous random variables In general if X is a continuous random variable where there is a function on the range of X so that Z Pr (a ≤ X ≤ b) = b f (x)dx a then f is called a probability density function (sometimes denoted p.d.f.). Christopher Croke Calculus 115 Continuous random variables In general if X is a continuous random variable where there is a function on the range of X so that Z Pr (a ≤ X ≤ b) = b f (x)dx a then f is called a probability density function (sometimes denoted p.d.f.). Christopher Croke Calculus 115 Probability density functions If a random variable takes values from A to B (B could be ∞ and A could be −∞) then f (x) ≥ 0 for all A ≤ x ≤ B. Christopher Croke Calculus 115 Probability density functions If a random variable takes values from A to B (B could be ∞ and A could be −∞) then f (x) ≥ 0 for all A ≤ x ≤ B. RB A f (x)dx = 1. Christopher Croke Calculus 115 Probability density functions If a random variable takes values from A to B (B could be ∞ and A could be −∞) then f (x) ≥ 0 for all A ≤ x ≤ B. RB A f (x)dx = 1. The integral could be improper. Christopher Croke Calculus 115 Probability density functions If a random variable takes values from A to B (B could be ∞ and A could be −∞) then f (x) ≥ 0 for all A ≤ x ≤ B. RB A f (x)dx = 1. The integral could be improper. . In fact any function satisfying the above two conditions is a probability density function R bfor a continuous random variable X . Define Pr (a ≤ X ≤ b) = a f (x)dx. Christopher Croke Calculus 115 Probability density functions If a random variable takes values from A to B (B could be ∞ and A could be −∞) then f (x) ≥ 0 for all A ≤ x ≤ B. RB A f (x)dx = 1. The integral could be improper. . In fact any function satisfying the above two conditions is a probability density function R bfor a continuous random variable X . Define Pr (a ≤ X ≤ b) = a f (x)dx. Note Pr (X = x0 ) = 0 for all x0 . Christopher Croke Calculus 115 Probability density functions If a random variable takes values from A to B (B could be ∞ and A could be −∞) then f (x) ≥ 0 for all A ≤ x ≤ B. RB A f (x)dx = 1. The integral could be improper. . In fact any function satisfying the above two conditions is a probability density function R bfor a continuous random variable X . Define Pr (a ≤ X ≤ b) = a f (x)dx. Note Pr (X = x0 ) = 0 for all x0 . On the other hand we can ask: “what the probability that x is near x0 ?”. Christopher Croke Calculus 115 Probability density functions If a random variable takes values from A to B (B could be ∞ and A could be −∞) then f (x) ≥ 0 for all A ≤ x ≤ B. RB A f (x)dx = 1. The integral could be improper. . In fact any function satisfying the above two conditions is a probability density function R bfor a continuous random variable X . Define Pr (a ≤ X ≤ b) = a f (x)dx. Note Pr (X = x0 ) = 0 for all x0 . On the other hand we can ask: “what the probability that x is near x0 ?”. How near? Christopher Croke Calculus 115 Probability density functions If a random variable takes values from A to B (B could be ∞ and A could be −∞) then f (x) ≥ 0 for all A ≤ x ≤ B. RB A f (x)dx = 1. The integral could be improper. . In fact any function satisfying the above two conditions is a probability density function R bfor a continuous random variable X . Define Pr (a ≤ X ≤ b) = a f (x)dx. Note Pr (X = x0 ) = 0 for all x0 . On the other hand we can ask: “what the probability that x is near x0 ?”. How near? ∆x near. Christopher Croke Calculus 115 Probability density functions 1 1 Pr (x0 − ∆x ≤ X ≤ x0 + ∆x) ≈ f (x0 ) · ∆x. 2 2 Christopher Croke Calculus 115 Probability density functions 1 1 Pr (x0 − ∆x ≤ X ≤ x0 + ∆x) ≈ f (x0 ) · ∆x. 2 2 Problem: Show that our first example: f (x) = 2ke −kx for 0 ≤ x ≤ T (where k = ln(2) T ) is a probability density. Christopher Croke Calculus 115 Probability density functions 1 1 Pr (x0 − ∆x ≤ X ≤ x0 + ∆x) ≈ f (x0 ) · ∆x. 2 2 Problem: Show that our first example: f (x) = 2ke −kx for 0 ≤ x ≤ T (where k = ln(2) T ) is a probability density. Problem: Let f (x) = k − x 2 for 0 ≤ x ≤ 1. a) What values of k make f (x) a probability density function? Christopher Croke Calculus 115 Probability density functions 1 1 Pr (x0 − ∆x ≤ X ≤ x0 + ∆x) ≈ f (x0 ) · ∆x. 2 2 Problem: Show that our first example: f (x) = 2ke −kx for 0 ≤ x ≤ T (where k = ln(2) T ) is a probability density. Problem: Let f (x) = k − x 2 for 0 ≤ x ≤ 1. a) What values of k make f (x) a probability density function? b) Find Pr (0 ≤ X ≤ 21 ) for the associated X . Christopher Croke Calculus 115 Probability density functions 1 1 Pr (x0 − ∆x ≤ X ≤ x0 + ∆x) ≈ f (x0 ) · ∆x. 2 2 Problem: Show that our first example: f (x) = 2ke −kx for 0 ≤ x ≤ T (where k = ln(2) T ) is a probability density. Problem: Let f (x) = k − x 2 for 0 ≤ x ≤ 1. a) What values of k make f (x) a probability density function? b) Find Pr (0 ≤ X ≤ 21 ) for the associated X . Comments the p.d.f. is not unique! Christopher Croke Calculus 115 Probability density functions 1 1 Pr (x0 − ∆x ≤ X ≤ x0 + ∆x) ≈ f (x0 ) · ∆x. 2 2 Problem: Show that our first example: f (x) = 2ke −kx for 0 ≤ x ≤ T (where k = ln(2) T ) is a probability density. Problem: Let f (x) = k − x 2 for 0 ≤ x ≤ 1. a) What values of k make f (x) a probability density function? b) Find Pr (0 ≤ X ≤ 21 ) for the associated X . Comments the p.d.f. is not unique! (e.g. Could change the value of f on a finite number of points and it doesn’t change integrals.) Christopher Croke Calculus 115 Probability density functions 1 1 Pr (x0 − ∆x ≤ X ≤ x0 + ∆x) ≈ f (x0 ) · ∆x. 2 2 Problem: Show that our first example: f (x) = 2ke −kx for 0 ≤ x ≤ T (where k = ln(2) T ) is a probability density. Problem: Let f (x) = k − x 2 for 0 ≤ x ≤ 1. a) What values of k make f (x) a probability density function? b) Find Pr (0 ≤ X ≤ 21 ) for the associated X . Comments the p.d.f. is not unique! (e.g. Could change the value of f on a finite number of points and it doesn’t change integrals.) There is usually a continuous one that works and we use that one. Christopher Croke Calculus 115 Probability density functions 1 1 Pr (x0 − ∆x ≤ X ≤ x0 + ∆x) ≈ f (x0 ) · ∆x. 2 2 Problem: Show that our first example: f (x) = 2ke −kx for 0 ≤ x ≤ T (where k = ln(2) T ) is a probability density. Problem: Let f (x) = k − x 2 for 0 ≤ x ≤ 1. a) What values of k make f (x) a probability density function? b) Find Pr (0 ≤ X ≤ 21 ) for the associated X . Comments the p.d.f. is not unique! (e.g. Could change the value of f on a finite number of points and it doesn’t change integrals.) There is usually a continuous one that works and we use that one. f (x) could be greater than 1 (in fact could be unbounded). Christopher Croke Calculus 115 Probability density functions 1 1 Pr (x0 − ∆x ≤ X ≤ x0 + ∆x) ≈ f (x0 ) · ∆x. 2 2 Problem: Show that our first example: f (x) = 2ke −kx for 0 ≤ x ≤ T (where k = ln(2) T ) is a probability density. Problem: Let f (x) = k − x 2 for 0 ≤ x ≤ 1. a) What values of k make f (x) a probability density function? b) Find Pr (0 ≤ X ≤ 21 ) for the associated X . Comments the p.d.f. is not unique! (e.g. Could change the value of f on a finite number of points and it doesn’t change integrals.) There is usually a continuous one that works and we use that one. f (x) could be greater than 1 (in fact could be unbounded). Only need the integrals to be less than 1. Christopher Croke Calculus 115 Cumulative Distribution Functions If X is a continuous random variable with density function f (x) defined on [A, B] then the cumulative distribution function (also known as c.d.f.) is the function Z x F (x) = f (t)dt A Christopher Croke Calculus 115 Cumulative Distribution Functions If X is a continuous random variable with density function f (x) defined on [A, B] then the cumulative distribution function (also known as c.d.f.) is the function Z x F (x) = f (t)dt = Pr (A ≤ X ≤ x) = Pr (X ≤ x). A Christopher Croke Calculus 115 Cumulative Distribution Functions If X is a continuous random variable with density function f (x) defined on [A, B] then the cumulative distribution function (also known as c.d.f.) is the function Z x F (x) = f (t)dt = Pr (A ≤ X ≤ x) = Pr (X ≤ x). A Note that the Fundamental Theorem of Calculus says that F 0 (x) = f (x). Christopher Croke Calculus 115 Cumulative Distribution Functions If X is a continuous random variable with density function f (x) defined on [A, B] then the cumulative distribution function (also known as c.d.f.) is the function Z x F (x) = f (t)dt = Pr (A ≤ X ≤ x) = Pr (X ≤ x). A Note that the Fundamental Theorem of Calculus says that F 0 (x) = f (x). Thus Z b f (x)dx = F (b) − F (a). Pr (a ≤ X ≤ b) = a Christopher Croke Calculus 115 Cumulative Distribution Functions If X is a continuous random variable with density function f (x) defined on [A, B] then the cumulative distribution function (also known as c.d.f.) is the function Z x F (x) = f (t)dt = Pr (A ≤ X ≤ x) = Pr (X ≤ x). A Note that the Fundamental Theorem of Calculus says that F 0 (x) = f (x). Thus Z b f (x)dx = F (b) − F (a). Pr (a ≤ X ≤ b) = a Christopher Croke Calculus 115 Cumulative Distribution Functions Note that F is exactly the antiderivative of f such that F (A) = 0. Christopher Croke Calculus 115 Cumulative Distribution Functions Note that F is exactly the antiderivative of f such that F (A) = 0. Problem: Find the cumulative distribution function for our first example (f (x) = 2ke −kx ). Christopher Croke Calculus 115 Cumulative Distribution Functions Note that F is exactly the antiderivative of f such that F (A) = 0. Problem: Find the cumulative distribution function for our first example (f (x) = 2ke −kx ). Problem: Let f (x) = x12 on x > 1. a) Show that f is a probability density. Christopher Croke Calculus 115 Cumulative Distribution Functions Note that F is exactly the antiderivative of f such that F (A) = 0. Problem: Find the cumulative distribution function for our first example (f (x) = 2ke −kx ). Problem: Let f (x) = x12 on x > 1. a) Show that f is a probability density. b) Find the c.d.f for f . Christopher Croke Calculus 115 Cumulative Distribution Functions Note that F is exactly the antiderivative of f such that F (A) = 0. Problem: Find the cumulative distribution function for our first example (f (x) = 2ke −kx ). Problem: Let f (x) = x12 on x > 1. a) Show that f is a probability density. b) Find the c.d.f for f . c) Find Pr (3 ≤ X ≤ 4). Christopher Croke Calculus 115 Cumulative Distribution Functions Note that F is exactly the antiderivative of f such that F (A) = 0. Problem: Find the cumulative distribution function for our first example (f (x) = 2ke −kx ). Problem: Let f (x) = x12 on x > 1. a) Show that f is a probability density. b) Find the c.d.f for f . c) Find Pr (3 ≤ X ≤ 4). Problem: A point is chosen at random from the unit square [0, 1] × [0, 1]. Let X be the sum of its two coordinates. Find the probability density function f (x) and the cumulative distribution function F (x). Christopher Croke Calculus 115 Cumulative Distribution Functions Note that F is exactly the antiderivative of f such that F (A) = 0. Problem: Find the cumulative distribution function for our first example (f (x) = 2ke −kx ). Problem: Let f (x) = x12 on x > 1. a) Show that f is a probability density. b) Find the c.d.f for f . c) Find Pr (3 ≤ X ≤ 4). Problem: A point is chosen at random from the unit square [0, 1] × [0, 1]. Let X be the sum of its two coordinates. Find the probability density function f (x) and the cumulative distribution function F (x). What is Pr (0.5 < X < 1)? Christopher Croke Calculus 115 Cumulative Distribution Functions Comments about a cumulative distribution function F : 0 ≤ F (x) ≤ 1. Christopher Croke Calculus 115 Cumulative Distribution Functions Comments about a cumulative distribution function F : 0 ≤ F (x) ≤ 1. limx→−∞ F (x) = 0 Christopher Croke Calculus 115 Cumulative Distribution Functions Comments about a cumulative distribution function F : 0 ≤ F (x) ≤ 1. limx→−∞ F (x) = 0 limx→∞ F (x) = 1 Christopher Croke Calculus 115 Cumulative Distribution Functions Comments about a cumulative distribution function F : 0 ≤ F (x) ≤ 1. limx→−∞ F (x) = 0 limx→∞ F (x) = 1 F (x) is nondecreasing. Christopher Croke Calculus 115 Cumulative Distribution Functions Comments about a cumulative distribution function F : 0 ≤ F (x) ≤ 1. limx→−∞ F (x) = 0 limx→∞ F (x) = 1 F (x) is nondecreasing. For a discrete probability distribution f (x) then the c.d.f F (x) = Pr (X ≤ x) = Σxi ≤x f (xi ). Christopher Croke Calculus 115 Cumulative Distribution Functions Comments about a cumulative distribution function F : 0 ≤ F (x) ≤ 1. limx→−∞ F (x) = 0 limx→∞ F (x) = 1 F (x) is nondecreasing. For a discrete probability distribution f (x) then the c.d.f F (x) = Pr (X ≤ x) = Σxi ≤x f (xi ). This is a “step function”. Christopher Croke Calculus 115 Bivariate Distributions This is the joint probability when you are given two random variables X and Y . Christopher Croke Calculus 115 Bivariate Distributions This is the joint probability when you are given two random variables X and Y . Consider the case when both are discrete random variables. Then the joint probability function f (x, y ) is the function: f (xi , yj ) = Pr (X = xi , Y = yj ). Christopher Croke Calculus 115 Bivariate Distributions This is the joint probability when you are given two random variables X and Y . Consider the case when both are discrete random variables. Then the joint probability function f (x, y ) is the function: f (xi , yj ) = Pr (X = xi , Y = yj ). So of course f (xi , yj ) ≥ 0 and the sum over all pairs (xi , yj ) of f (xi , yj ) is 1. Christopher Croke Calculus 115 Bivariate Distributions This is the joint probability when you are given two random variables X and Y . Consider the case when both are discrete random variables. Then the joint probability function f (x, y ) is the function: f (xi , yj ) = Pr (X = xi , Y = yj ). So of course f (xi , yj ) ≥ 0 and the sum over all pairs (xi , yj ) of f (xi , yj ) is 1. Often it is given in the form of a table. X ↓Y → 0 2 4 1 0.1 0.1 0.1 2 0 0.4 0 3 0.2 0 0.1 Christopher Croke Calculus 115 Bivariate Distributions This is the joint probability when you are given two random variables X and Y . Consider the case when both are discrete random variables. Then the joint probability function f (x, y ) is the function: f (xi , yj ) = Pr (X = xi , Y = yj ). So of course f (xi , yj ) ≥ 0 and the sum over all pairs (xi , yj ) of f (xi , yj ) is 1. Often it is given in the form of a table. X ↓Y → 0 2 4 1 0.1 0.1 0.1 2 0 0.4 0 3 0.2 What is Pr(X=0,Y=3)? 0 0.1 Christopher Croke Calculus 115 Bivariate Distributions This is the joint probability when you are given two random variables X and Y . Consider the case when both are discrete random variables. Then the joint probability function f (x, y ) is the function: f (xi , yj ) = Pr (X = xi , Y = yj ). So of course f (xi , yj ) ≥ 0 and the sum over all pairs (xi , yj ) of f (xi , yj ) is 1. Often it is given in the form of a table. X ↓Y → 0 2 4 Pr (X ≥ 3, Y 1 2 0.1 0 0.1 0.4 0.1 0 ≥ 2)? 3 0.2 What is Pr(X=0,Y=3)? 0 0.1 Christopher Croke Calculus 115 Bivariate Distributions This is the joint probability when you are given two random variables X and Y . Consider the case when both are discrete random variables. Then the joint probability function f (x, y ) is the function: f (xi , yj ) = Pr (X = xi , Y = yj ). So of course f (xi , yj ) ≥ 0 and the sum over all pairs (xi , yj ) of f (xi , yj ) is 1. Often it is given in the form of a table. X ↓Y → 0 2 4 Pr (X ≥ 3, Y 1 2 3 0.1 0 0.2 What is Pr(X=0,Y=3)? 0.1 0.4 0 0.1 0 0.1 ≥ 2)? Pr (X = 2)? Christopher Croke Calculus 115 Bivariate Distributions If X and Y are continuous random variables then the joint probability density function is a function f (x, y ) of two real variables such that for any domain A in the plane: Z Z Pr ((X , Y ) ∈ A) = f (x, y )dxdy . A Christopher Croke Calculus 115 Bivariate Distributions If X and Y are continuous random variables then the joint probability density function is a function f (x, y ) of two real variables such that for any domain A in the plane: Z Z Pr ((X , Y ) ∈ A) = f (x, y )dxdy . A We want f (x, y ) ≥ 0 and R∞ R∞ −∞ −∞ f (x, y )dxdy Christopher Croke Calculus 115 = 1. Bivariate Distributions If X and Y are continuous random variables then the joint probability density function is a function f (x, y ) of two real variables such that for any domain A in the plane: Z Z Pr ((X , Y ) ∈ A) = f (x, y )dxdy . A R∞ R∞ We want f (x, y ) ≥ 0 and −∞ −∞ f (x, y )dxdy = 1. Problem: Let f be a joint probability density function (j.p.d.f.) for X and Y where c(x + y ) if x ≥ 0, y ≥ 0, y ≤ 1 − x f (x, y ) = 0 othewise a) What is c? Christopher Croke Calculus 115 Bivariate Distributions If X and Y are continuous random variables then the joint probability density function is a function f (x, y ) of two real variables such that for any domain A in the plane: Z Z Pr ((X , Y ) ∈ A) = f (x, y )dxdy . A R∞ R∞ We want f (x, y ) ≥ 0 and −∞ −∞ f (x, y )dxdy = 1. Problem: Let f be a joint probability density function (j.p.d.f.) for X and Y where c(x + y ) if x ≥ 0, y ≥ 0, y ≤ 1 − x f (x, y ) = 0 othewise a) What is c? b) Find Pr (X ≤ 21 ). Christopher Croke Calculus 115 Bivariate Distributions If X and Y are continuous random variables then the joint probability density function is a function f (x, y ) of two real variables such that for any domain A in the plane: Z Z Pr ((X , Y ) ∈ A) = f (x, y )dxdy . A R∞ R∞ We want f (x, y ) ≥ 0 and −∞ −∞ f (x, y )dxdy = 1. Problem: Let f be a joint probability density function (j.p.d.f.) for X and Y where c(x + y ) if x ≥ 0, y ≥ 0, y ≤ 1 − x f (x, y ) = 0 othewise a) What is c? b) Find Pr (X ≤ 21 ). c) Set up integral for Pr (Y ≤ X ). Christopher Croke Calculus 115 Bivariate Distributions In some cases X might be discrete and Y continuous (or vice versa). Christopher Croke Calculus 115 Bivariate Distributions In some cases X might be discrete and Y continuous (or vice versa). R∞ In this case we would want −∞ Σxi f (xi , y )dy = 1. Christopher Croke Calculus 115 Bivariate Distributions In some cases X might be discrete and Y continuous (or vice versa). R∞ In this case we would want −∞ Σxi f (xi , y )dy = 1. The (cumulative) joint distribution function for continuous random variables X and Y is Z x Z y F (x, y ) = Pr (X ≤ x, Y ≤ y ) = f (s, t)dtds. −∞ Christopher Croke Calculus 115 −∞ Bivariate Distributions In some cases X might be discrete and Y continuous (or vice versa). R∞ In this case we would want −∞ Σxi f (xi , y )dy = 1. The (cumulative) joint distribution function for continuous random variables X and Y is Z x Z y F (x, y ) = Pr (X ≤ x, Y ≤ y ) = f (s, t)dtds. −∞ (Use sums if discrete.) Christopher Croke Calculus 115 −∞ Bivariate Distributions In some cases X might be discrete and Y continuous (or vice versa). R∞ In this case we would want −∞ Σxi f (xi , y )dy = 1. The (cumulative) joint distribution function for continuous random variables X and Y is Z x Z y F (x, y ) = Pr (X ≤ x, Y ≤ y ) = f (s, t)dtds. −∞ (Use sums if discrete.) Thus we see that if F is differentiable f (x, y ) = Christopher Croke ∂2F ∂x∂y Calculus 115 −∞ Bivariate Distributions What is the probability in a rectangle? I.e. Pr (a ≤ X ≤ b, c ≤ Y ≤ d)? Christopher Croke Calculus 115 Bivariate Distributions What is the probability in a rectangle? I.e. Pr (a ≤ X ≤ b, c ≤ Y ≤ d)? F (b, d) − F (a, d) − F (b, c) + F (a, c). Christopher Croke Calculus 115 Bivariate Distributions What is the probability in a rectangle? I.e. Pr (a ≤ X ≤ b, c ≤ Y ≤ d)? F (b, d) − F (a, d) − F (b, c) + F (a, c). Given F (x, y ) a c.j.d.f. for X and Y we can find the two c.d.f.’s by: F1 (x) = Pr (X ≤ x) Christopher Croke Calculus 115 Bivariate Distributions What is the probability in a rectangle? I.e. Pr (a ≤ X ≤ b, c ≤ Y ≤ d)? F (b, d) − F (a, d) − F (b, c) + F (a, c). Given F (x, y ) a c.j.d.f. for X and Y we can find the two c.d.f.’s by: F1 (x) = Pr (X ≤ x) = lim Pr (X ≤ x, Y ≤ y ) y →∞ Christopher Croke Calculus 115 Bivariate Distributions What is the probability in a rectangle? I.e. Pr (a ≤ X ≤ b, c ≤ Y ≤ d)? F (b, d) − F (a, d) − F (b, c) + F (a, c). Given F (x, y ) a c.j.d.f. for X and Y we can find the two c.d.f.’s by: F1 (x) = Pr (X ≤ x) = lim Pr (X ≤ x, Y ≤ y ) = lim F (x, y ). y →∞ Christopher Croke y →∞ Calculus 115 Bivariate Distributions What is the probability in a rectangle? I.e. Pr (a ≤ X ≤ b, c ≤ Y ≤ d)? F (b, d) − F (a, d) − F (b, c) + F (a, c). Given F (x, y ) a c.j.d.f. for X and Y we can find the two c.d.f.’s by: F1 (x) = Pr (X ≤ x) = lim Pr (X ≤ x, Y ≤ y ) = lim F (x, y ). y →∞ y →∞ Similarly F2 (y ) = lim F (x, y ). x→∞ Christopher Croke Calculus 115