Probability of sinking a ship

307 Views Asked by At

Captain A and Captain B are at combat with each other on ships. Captain A has a 1/4 chance for him to hit Captain B with his cannon. If Captain A hits a shot, there is 1/2 chance that the ship will go down. If the ship doesn't go down, there is a 1/4 chance that the shot still did some damage. It takes 2 damaging shots for the ship to go down. Captain A only has 4 shots left in his cannon. If he takes down Captain B's ship before using all 4 shots, he will stop shooting, if not he will keep shooting until he runs out of shots.

What is the probability Captain A will sink Captain B's ship?

I have listed all the possible ways Captain A can win, obtained the probability of each scenario happening and added together to get 767/2048. But if I take the scenarios in which Captain A loses, obtain the probability of it happening, and subtract it from 1, I get 1319/2048. I was wondering which way is correct, and if my method of doing it is correct.

Calculations:

1 = hit 0 = miss

Scenarios in which he wins:

1 = 1/8

11 = 1/32 * 1/4= 1/128

101 = 1/32 * 3/4 * 1/4 = 3/512

1001 = 1/32 * 3/4 * 3/4 * 1/4 = 9/2048

01 = 3/4 * 1/8 = 3/32

011 = 3/4 * 1/32 * 1/4 = 3/512

0101 = 3/4 * 1/32 * 3/4 * 1/4 = 9/2048

001 = 3/4 * 3/4 * 1/4 = 9/128

0011 = 3/4 * 3/4 * 1/32 * 1/4 = 9/2048

0001 = 3/4 * 3/4 * 3/4 * 1/8 = 27/512

Final = 767/2048

Scenarios in which he loses:

0000 = 3/4 * 3/4 * 3/4 * 3/4 = 81/256

1000 = 1/32 * 3/4 * 3/4 * 3/4 = 27/2048

0100 = 3/4 * 1/32 * 3/4 * 3/4 = 27/2048

0010 = 3/4 * 3/4 * 1/32 * 3/4 = 27/2048

0001 = 3/4 * 3/4 * 3/4 * 1/32 = 27/2048

Final = 1 - 729/2048 = 1319/2048

2

There are 2 best solutions below

0
On

Let $S_n^k$ be the event that shot $n$ does $k$ damage.

So the probabilities for $k=0,1,2$ are $\frac{13}{16}, \frac{1}{16},\frac{2}{16}$, with $k>0$ being $\frac{3}{16}$.

The winning events are then:

  • $S_1^2$

  • $S_1^1S_2^{>0}$

  • $S_1^1S_2^0S_3^{>0}$

  • $S_1^1S_2^0S_3^0S_4^{>0}$

  • $S_1^0S_2^2$

  • $S_1^0S_2^1S_3^{>0}$

  • $S_1^0S_2^1S_3^0S_4^{>0}$

  • $S_1^0S_2^0S_3^2$

  • $S_1^0S_2^0S_3^1S_4^{>0}$

  • $S_1^0S_2^0S_3^0S_4^2$

Each event can be determined solely by their $k$-sequences.

Placing these into Excel and doing the sums gives:

cannon firing

So the probabilty of sinking the ship is $\approx0.43$.

0
On
  • First directly finding the probability of ship B going down -

a) In one hit -

It can be in first, second, third or fourth attempt but it has to be bullseye as a damage won't do.

$ \displaystyle \frac{1}{8} + \frac{3}{4} \cdot \frac{1}{8} + \frac{3^2}{4^2} \cdot \frac{1}{8} + \frac{3^3}{4^3} \cdot \frac{1}{8} = \frac{175}{512}$

b) In two hits -

It can be in two, three or four attempts. Also it can either be through damages in both hits or a bullseye in second hit. In case of a _bullseye in second hit, it does not matter whether the first hit did a damage or nothing.

$ \displaystyle \frac{1}{4^2} \cdot \left(\frac{1}{2^2} \cdot \frac{1}{4^2} + \frac{1}{2^2} \right) \cdot \left(1 + 2 \cdot \frac{3}{4} + 3 \cdot \frac{3^2}{4^2}\right) = \frac{1139}{16384}$

Please note that $ \displaystyle 1 + 2 \cdot \frac{3}{4} + 3 \cdot \frac{3^2}{4^2}$ is the number of ways to choose which two of the four attempts are hits.

c) Similarly in $3$ hits,

The third hit is either a damage or a bullseye. Unless the last hit is a bullseye, there will be exactly one more hit before, which does a damage.

$ \displaystyle \frac{1}{4^3} \cdot \left(\frac{1}{2^3} \cdot 2 \cdot \frac{3}{4^3} + \frac{1}{2^3} \cdot \frac{3^2}{4^2} + \frac{1}{2^3} \cdot 2 \cdot \frac{3}{4^2} \right) \cdot \left(1 + 3 \cdot \frac{3}{4}\right) = \frac{429}{65536}$

d) Similarly in $4$ hits,

The fourth hit is either a damage or a bullseye. Unless the last hit is a bullseye, there will be exactly one more hit before, which does a damage.

$ \displaystyle \frac{1}{4^4} \cdot \left(\frac{1}{2^4} \cdot 3 \cdot \frac{3^2}{4^4} + \frac{1}{2^4} \cdot \frac{3^3}{4^3} + \frac{1}{2^4} \cdot 3 \cdot \frac{3^2}{4^3} \right) = \frac{243}{1048576}$

Add all of them and the probability of ship $B$ going down is $ \ \displaystyle \fbox {$\frac{438403}{1048576}$}$

- Now first finding probability that ship B does not go down -

a) there are no hits -

Probability is $ \displaystyle \frac{3^4}{4^4} = \frac{81}{256}$

b) There is one hit -

The hit cannot be a bullseye but it may or may not cause damage as the ship would not go down with damage in one hit.

$ \displaystyle 4 \cdot \frac{3^3}{4^4} \cdot \frac{1}{2} = \frac{27}{128}$

b) There are two hits -

There can be maximum one hit causing damage.

$ \displaystyle {4 \choose 2} \cdot \frac{3^2}{4^4} \cdot \frac{1}{2^2} (\frac{3^2}{4^2} + 2 \cdot \frac{3}{4^2}) = \frac{405}{8192}$

b) Three hits -

There can be maximum one hit causing damage.

$ \displaystyle 4 \cdot \frac{3}{4^4} \cdot \frac{1}{2^3} (\frac{3^3}{4^3} + 3 \cdot \frac{3^2}{4^3}) = \frac{81}{16384}$

b) Four hits -

Again, there can be maximum one hit causing damage.

$ \displaystyle \frac{1}{4^4} \cdot \frac{1}{2^4} (\frac{3^4}{4^4} + 4 \cdot \frac{3^3}{4^4}) = \frac{189}{1048576}$

Adding them up, we get $ \displaystyle \frac{610173}{1048576}$.

Subtracting from $1$, we get probability of $ \ \displaystyle \fbox{$\frac{438403}{1048576}$} \ $ that ship $B$ goes down.