User Tools

Site Tools


b:head_first_statistics:using_discrete_probability_distributions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
b:head_first_statistics:using_discrete_probability_distributions [2019/10/10 18:35] – [Fat Dan changed his prices] hkimscilb:head_first_statistics:using_discrete_probability_distributions [2019/10/14 03:49] – [Fat Dan changed his prices] hkimscil
Line 384: Line 384:
 Var(X + Y) & = & Var(X) + Var(Y) \\  Var(X + Y) & = & Var(X) + Var(Y) \\ 
 E(X - Y) & = & E(X) - E(Y) \\ E(X - Y) & = & E(X) - E(Y) \\
-Var(X - Y) & = & Var(X) Var(Y) \\ +Var(X - Y) & = & Var(X) Var(Y) \\ 
 E(aX + bY) & = & aE(X) + bE(Y)  \\ E(aX + bY) & = & aE(X) + bE(Y)  \\
 Var(aX + bY) & = & a^{2}Var(X) + b^{2}Var(Y) \\  Var(aX + bY) & = & a^{2}Var(X) + b^{2}Var(Y) \\ 
 E(aX - bY) & = & aE(X) - bE(Y)  \\ E(aX - bY) & = & aE(X) - bE(Y)  \\
-Var(aX - bY) & = & a^{2}Var(X) b^{2}Var(Y) \\ +Var(aX - bY) & = & a^{2}Var(X) b^{2}Var(Y) \\ 
 \end{eqnarray*} \end{eqnarray*}
 +
 +----
 +A restaurant offers two menus, one for weekdays and the other for weekends. Each menu offers four set prices, and the probability distributions for the amount someone pays is as follows:
  
 | Weekday:  ||||| | Weekday:  |||||
Line 398: Line 401:
 | y  | 15  | 20  | 25  | 30  |  | y  | 15  | 20  | 25  | 30  | 
 | P(Y = y)  | 0.15  | 0.6  | 0.2  | 0.05  | | P(Y = y)  | 0.15  | 0.6  | 0.2  | 0.05  |
 +
 +Who would you expect to pay the restaurant most: a group of 20 eating at the weekend, or a group of 25 eating on a weekday?
 +
 +<code>
 +x1 <- c(10,15,20,25) 
 +x1p <- c(.2,.5,.2,.1)
 +x2 <- c(15,20,25,30)
 +x2p <- c(.15,.6,.2,.05)
 +x1n <- 25
 +x2n <- 20
 +
 +x1mu <- sum(x1*x1p)
 +x2mu <- sum(x2*x2p)
 +
 +x1e <- x1mu*x1num
 +x2e <- x2mu*x2num
 +
 +x1e
 +x2e
 +</code>
 +
 +<code>> x1e
 +[1] 400
 +> x2e
 +[1] 415
 +> </code>
 +x2e will spend more.
 +
 +====== e.g. ======
 +
 +| Restaurant A:   |||||  
 +| x  | 20  | 30  | 40  | 45  | 
 +| P(X = x)  | 0.3  | 0.4  | 0.2  | 0.1  | 
 + 
 +| Restaurant B:   ||||
 +| y  | 10  | 15  | 18  | 
 +| P(Y = y)  | 0.2  | 0.6  | 0.2  | 
  
b/head_first_statistics/using_discrete_probability_distributions.txt · Last modified: 2023/10/04 10:29 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki