gaming hint problem

Hao is playing a video game.

On the one hand, suppose there exists an hint for each movement. The probability that the hint is “to shot” is $p_1$. When the hint is “to shot” and the actual best movement is “to shot” with a probability of $p_2$. That if the hint does not imply him to shot but the real best movement is “to shot” has a probability of $p_3$.

On the other hand, the probability that Hao sees the hint is $p_4$. If he sees the hint then he will always shot, and if not then he will not shot. If he misses the hint then Hao will flip a fair coin to decide whether or not to shot.

Interpret

  • Event A: the hint is “shot”.
    • $P(A)=p_1$
    • $P(A^C)=1-p_1$ (the hint is “not shot”)
  • Event B: actually the best movement is “to shot”.
    • $P(B)=P((Bcap A)cup(Bcap A^C))$
      • $=P(Bmid A)cdot P(A)+P(Bmid A^C)cdot P(A^C)$
      • $=p_2cdot p_1+p_3cdot (1-p_1)$
      • $=p_1p_2-p_1p_3+p_3$
    • $P(B^C)=P((B^Ccap A)cup(B^Ccap A^C))$
      • $=P(B^Cmid A)cdot P(A)+P(B^Cmid A^C)cdot P(A^C)$
      • $=(1-p_2)cdot p_1+(1-p_3)cdot (1-p_1)$
      • $=1-p_1p_2+p_1p_3-p_3$
      • (Event $B^C$: actually the best movement is “not to shot”.)
    • Validation:
      • $P(B)+P(B^C)$
      • $=(p_1p_2-p_1p_3+p_3)+(1-p_1p_2+p_1p_3-p_3)$
      • $=1$
  • Event C: Hao sees the hint.
    • $P(C)=p_4$
    • $P(C^C)=1-p_4$ (Hao doesn’t see the hint)
  • Event D: flipping a fair coin:
    • $P(D)=P(D^C)=frac{1}{2}$
  • Event E: Hao does shot.
    • $P(E)=P((Ecap C)cup(Ecap C^C))$
      • $=P(Emid C)cdot P(C)+P(Emid C^C)cdot P(C^C)$
      • $=1cdot P(A)cdot P(C)+P(D)cdot P(C^C)$
      • $=p_1p_4+frac{1}{2}(1-p_4)$
    • $P(E^C)=P((E^Ccap C)cup(E^Ccap C^C))$
      • $=P(E^Cmid C)cdot P(C)+P(E^Cmid C^C)cdot P(C^C)$
      • $=1cdot P(A^C)cdot P(C)+P(D^C)cdot P(C^C)$
      • $=(1-p_1)p_4+frac{1}{2}(1-p_4)$
      • $=frac{1}{2}+frac{1}{2}p_4-p_1p_4$
      • (Event $E^C$: Hao does not shot.)
    • Validation:
      • $P(E)+P(E^C)$
      • $=(p_1p_4+frac{1}{2}-frac{1}{2}p_4)+(frac{1}{2}+frac{1}{2}p_4-p_1p_4)$
      • $=1$

Q1

In one move, Hao misses the hint and he do one kind of action. Whatever it is, the real best movement is “to shot”. What is the probability of the hint being “to shot”?

$because$ Event $C,C^C$ are independent of both Event A and B.
$therefore P(Amid (C^Ccap B))=cfrac{P(Acap Bcap C^C)}{P(Bcap C^C)}$
$=cfrac{P(C^C)P(Acap B)}{P(C^C)P(B)}$
$=cfrac{P(Bcap A)}{P(B)}$
$=cfrac{P(Bmid A)P(A)}{P(B)}$
$=cfrac{p_2p_1}{p_1p_2-p_1p_3+p_3}$

Q2

Are events $A^C$ and $E$ independent?

$P(A^Ccap E)=P((A^Ccap Ecap C)cup (A^Ccap Ecap C^C))$
$=P(Ecap A^Ccap C)+(A^Ccap(Ecap C^C))$
$=0+P(A^C)P(C^C)P(D)$
$=(1-p_1)(1-p_4)frac{1}{2}$
$=frac{1}{2}-frac{1}{2}p_1-frac{1}{2}p_4+p_1p_4$

$P(A^C)P(E)$
$=p_1(frac{1}{2}+frac{1}{2}p_4-p_1p_4)$
$=frac{1}{2}p_1+frac{1}{2}p_1p_4-p^2_1p_4$

$because P(A^Ccap E)ne P(A^C)P(E)$
$therefore A^C$ and $E$ are dependent.

Q3

Hao is shooting but the best movement is not to shot. What is the probability that he saw the hint?



(AB’ and DB’shown in the figure above are event $Acap B^C$ and $Dcap B^C$ respectively.)

$P(Cmid Ecap B^C)$
$=cfrac{P(AB’)}{P(AB’)+P(DB’)}$
$=cfrac{p_4p_1(1-p_2)}{p_4p_1(1-p_2)+(1-p_4)cdotfrac{1}{2}cdot(p_1(1-p_2)+(1-p_1)(1-p_3))}$

Reference Code

The probability graph was built by R, Rgraphviz and Rstudio.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
require(Rgraphviz)

node1 <- "P"
node2 <- "SH"
node3 <- "NSH"
node4 <- "HS"
node5 <- "HNS"
node6 <- "FS"
node7 <- "FNS"
node8 <- "H1S"
node9 <- "H1NS"
node10 <- "H0S"
node11 <- "H0NS"
node12 <- "F1S"
node13 <- "F1NS"
node14 <- "F0S"
node15 <- "F0NS"

node1 <- "P"
node2 <- "C"
node3 <- "C'"
node4 <- "A-E"
node5 <- "A'-E'"
node6 <- "D-E"
node7 <- "D'-E'"
node8 <- "A-B"
node9 <- "A-B'"
node10 <- "A'-B"
node11 <- "A'-B'"
node12 <- "D-B"
node13 <- "D-B'"
node14 <- "D'-B"
node15 <- "D'-B'"
nodeNames <- c(node1,node2,node3,node4,node5,node6, node7, node8, node9, node10, node11, node12, node13, node14, node15)
hPD <- new("graphNEL", nodes=nodeNames, edgemode="directed")

hPD <- addEdge(nodeNames[1], nodeNames[2], hPD, 1)
hPD <- addEdge(nodeNames[1], nodeNames[3], hPD, 1)
hPD <- addEdge(nodeNames[2], nodeNames[4], hPD, 1)
hPD <- addEdge(nodeNames[2], nodeNames[5], hPD, 1)
hPD <- addEdge(nodeNames[3], nodeNames[6], hPD, 1)
hPD <- addEdge(nodeNames[3], nodeNames[7], hPD, 1)
hPD <- addEdge(nodeNames[4], nodeNames[8], hPD, 1)
hPD <- addEdge(nodeNames[4], nodeNames[9], hPD, 1)
hPD <- addEdge(nodeNames[5], nodeNames[10], hPD, 1)
hPD <- addEdge(nodeNames[5], nodeNames[11], hPD, 1)
hPD <- addEdge(nodeNames[6], nodeNames[12], hPD, 1)
hPD <- addEdge(nodeNames[6], nodeNames[13], hPD, 1)
hPD <- addEdge(nodeNames[7], nodeNames[14], hPD, 1)
hPD <- addEdge(nodeNames[7], nodeNames[15], hPD, 1)

eAttrs <- list()
eAttrs$label <- c("p4","1-p4","p1","1-p1",toString(.5),toString(.5),"p2","1-p2","p3","1-p3","p1p2+p3(1-p1)","p1(1-p2)+(1-p1)(1-p3)","p1p2+p3(1-p1)","p1(1-p2)+(1-p1)(1-p3)")
names(eAttrs$label) <- edgeNames(hPD)
attributes <- list()
attributes$node <- list(fillcolor="lightgreen", fontsize=12)
attributes$edge <- list(color="red", fontsize=12)
attributes$graph <- list(rankdir="LR")
plot(hPD, edgeAttrs=eAttrs, attrs=attributes)

[1] Harry Surden. (2015, March 2). Probability Tree Diagrams in R | Harry Surden. Retrieved from http://www.harrysurden.com/wordpress/archives/292