返回题库

三环靶

Three Rings

专题
Probability / 概率
难度
L5

第 1 小问

题目详情

你正在向具有三个环的目标射箭:一个半径为 4 英寸的圆,周围有一个半径为 8 英寸的环,还有一个半径为 12 英寸的环。每支箭随机均匀地击中目标某处。

你在三个环中的每一个中恰好射中一支箭的概率是多少?

You are shooting arrows at a target with three rings: there is a circle with a 4 inch radius, a ring around it with an 8 inch radius, and a ring around that with a 12 inch radius. Each arrow hits the target somewhere uniformly at random.

What’s the probability that you land exactly one arrow in each of the three rings?

解析

我们将击球击中内环的事件表示为 A,击中中环的事件为 B,击中外环的事件为 C。有 3!=63! = 6 方法来对 3 个击球进行排序,使得击球落在 3 个环(ABC、ACB、BAC、BCA、CAB、CBA)中的每一个中。

我们可以使用相对面积计算每个事件 A、B 和 C 的概率。总目标空间的面积为122π12^2\pi。 A的面积为42π4^2\pi。因此,

P(A)=42π122π=16144=19P(A) = \frac{4^2\pi}{12^2\pi} = \frac{16}{144} = \frac{1}{9}

P(B) 可以通过仅计算第二个环的面积,然后除以整个环的面积来找到。只有第二个环的面积是第二个圆的面积减去内圆的面积:82π42π=48π8^2\pi - 4^2\pi = 48\pi。除以整个目标的面积 122π12^2\pi,我们得到

P(C)=48144=39P(C) = \frac{48}{144} = \frac{3}{9}

最后,P(C) 是外环面积除以圆的总面积。通过与上面类似的方法,我们确定这是

P(B)=122π82π122π=80144=59P(B) = \frac{12^2\pi - 8^2\pi}{12^2\pi} = \frac{80}{144} = \frac{5}{9}

给定顺序(例如 ABC)的概率为

P(A)P(B)P(C)=161444814480144=193959=15729P(A) * P(B) * P(C) = \frac{16}{144} * \frac{48}{144} * \frac{80}{144} = \frac{1}{9} * \frac{3}{9} * \frac{5}{9} = \frac{15}{729}

我们相乘,因为三个镜头中的每一个都是独立且连续的事件。

请注意,无论事件的顺序如何,由于乘法的交换律,相应概率的乘积将相同。因此,我们将三个目标 (6) 击中的排序方式数量乘以任何排序发生的概率:

615729=90729=0.1234=12.34%6 * \frac{15}{729} = \frac{90}{729} = 0.1234 = 12.34\%
import random
import numpy as np

# PART 1

def simulate_trial():
    lst = []
    for i in range(3):
        # randomly choose A, B, or C according to respective probabilities
        val = np.random.choice(["A", "B", "C"], p=[1/9, 3/9, 5/9])
        lst.append(val)
    return lst

# counter number of successes
num_successes = 0

# simulate trial 100,000 times
for i in range(100000):
    trial = simulate_trial()
    # see if there are three unique values -> A, B, C
    if len(np.unique(trial)) == 3:
        # if so, increase the number of successes by 1
        num_successes += 1

# expected proportion around 90/729 or 0.1234
print(num_successes/100000)

Original Explanation

Let’s denote the the event that the shot hits the inner ring as A, hits the middle ring as B, and the outer ring C. There are 3!=63! = 6 ways to order the 3 shots such that one lands in each of the 3 rings (ABC, ACB, BAC, BCA, CAB, CBA).

We can calculate the probability of each event A, B, and C using relative areas. The area of the total target space is 122π12^2\pi. The area of A is 42π4^2\pi. Therefore,

P(A)=42π122π=16144=19P(A) = \frac{4^2\pi}{12^2\pi} = \frac{16}{144} = \frac{1}{9}.

P(B) can be found by computing the area of only the second ring, and dividing by the area of the whole circle. The area of only the second ring is the area of the second circle minus the area of the inner circle: 82π42π=48π8^2\pi - 4^2\pi = 48\pi. Dividing by the area of the whole target, 122π12^2\pi, we get

P(C)=48144=39P(C) = \frac{48}{144} = \frac{3}{9}.

Lastly, P(C) is the area of the outer ring divided by the total area of the circle. By a similar approach to above, we determine this to be

P(B)=122π82π122π=80144=59P(B) = \frac{12^2\pi - 8^2\pi}{12^2\pi} = \frac{80}{144} = \frac{5}{9}.

The probability of a given ordering, say ABC, is

P(A)P(B)P(C)=161444814480144=193959=15729P(A) * P(B) * P(C) = \frac{16}{144} * \frac{48}{144} * \frac{80}{144} = \frac{1}{9} * \frac{3}{9} * \frac{5}{9} = \frac{15}{729}

We multiply across since each of the three shots are independent and successive events.

Notice that regardless of the ordering of events, the product of the respective probabilities will be the same due to the commutative property of multiplication. Therefore, we multiply the number of ways to order the hitting of the three targets (6) by the probability of any ordering occurring:

615729=90729=0.1234=12.34%6 * \frac{15}{729} = \frac{90}{729} = 0.1234 = 12.34\%
import random
import numpy as np

# PART 1

def simulate_trial():
    lst = []
    for i in range(3):
        # randomly choose A, B, or C according to respective probabilities
        val = np.random.choice(["A", "B", "C"], p=[1/9, 3/9, 5/9])
        lst.append(val)
    return lst

# counter number of successes
num_successes = 0

# simulate trial 100,000 times
for i in range(100000):
    trial = simulate_trial()
    # see if there are three unique values -> A, B, C
    if len(np.unique(trial)) == 3:
        # if so, increase the number of successes by 1
        num_successes += 1

# expected proportion around 90/729 or 0.1234
print(num_successes/100000)

第 2 小问

题目详情

现在你射 3n3n 箭。推导出一个表达式,表示你精确 nn 箭头落在 3 个环中的每个环中的概率?

Now you shoot 3n3n arrows. Derive an expression that represents the probability that you land exactly nn arrows in each of the 3 rings?

解析

我们从总共 3N 个箭头中选择 N 个落在 A、B 或 C 中。剩下的 2N 个箭头中的 N 个落在其他两个类别中。剩下的N支箭中的N支落在最后。结果,我们得到的有效订单数为

(3NN)(2NN)(NN)\dbinom{3N}{N} * \dbinom{2N}{N} * \dbinom{N}{N}

发生这种排序的概率是

P(A)NP(B)NP(C)N=(P(A)P(B)P(C))N=(15/729)NP(A)^N * P(B)^N * P(C)^N = (P(A) * P(B) * P(C)) ^ N = (15/729)^N

对于 N=1,就像在原始示例中一样,我们有 (31)(21)(11)(15/729)1\dbinom{3}{1} * \dbinom{2}{1} * \dbinom{1}{1} * (15/729)^1,这与我们期望根据第 1 部分的计算得到的值完全相同。

对于 N=2,我们有 (62)(42)(22)(15/729)2=15610.0004233=0.0381=3.81%\dbinom{6}{2} * \dbinom{4}{2} * \dbinom{2}{2} * (15/729)^2 = 15 * 6 * 1 * 0.0004233 = 0.0381 = 3.81\%

最后,我们将用代码验证的示例是 N=3。我们预计概率为

(93)(63)(33)(15/729)3=16800.000008711=0.0146=1.46%\dbinom{9}{3} * \dbinom{6}{3} * \dbinom{3}{3} * (15/729)^3 = 1680 * 0.000008711 = 0.0146 = 1.46\%

答案:(3NN)(2NN)(NN)(15/729)N\dbinom{3N}{N} * \dbinom{2N}{N} * \dbinom{N}{N} * (15/729)^N

import random
import numpy as np
from collections import Counter

# PART 2

n = 3

def simulate_trial():
    lst = []
    for i in range(3*n):
        val = np.random.choice(["A", "B", "C"], p=[1/9, 3/9, 5/9])
        lst.append(val)
    return lst

num_successes = 0

# simulate trial 100,000 times
for i in range(100000):
    trial = simulate_trial()
    dict_ = Counter(trial)
    # if each A, B, and C show up exactly 3 times
    if (dict_["A"] == 3 and dict_["B"] == 3 and dict_["C"] == 3):
        num_successes += 1

# expected proportion around 0.0146 or 1.46%
print(num_successes / 100000)

Original Explanation

We’re choosing N of the total 3N arrows to land in A, B, or C. N of the remaining 2N arrows to land in the other two categories. And N of the remaining N arrows to land in the last. As a result, we are given the number of valid orderings as

(3NN)(2NN)(NN)\dbinom{3N}{N} * \dbinom{2N}{N} * \dbinom{N}{N}

And the probability of such an ordering occurring is

P(A)NP(B)NP(C)N=(P(A)P(B)P(C))N=(15/729)NP(A)^N * P(B)^N * P(C)^N = (P(A) * P(B) * P(C)) ^ N = (15/729)^N

For N=1, like in the original example, we have (31)(21)(11)(15/729)1\dbinom{3}{1} * \dbinom{2}{1} * \dbinom{1}{1} * (15/729)^1 which is exactly the same value we expected to get based off our calculations from part 1.

For N=2, we have (62)(42)(22)(15/729)2=15610.0004233=0.0381=3.81%\dbinom{6}{2} * \dbinom{4}{2} * \dbinom{2}{2} * (15/729)^2 = 15 * 6 * 1 * 0.0004233 = 0.0381 = 3.81\%.

Lastly, and the example we’ll verify with code, is for N=3. We’d expect a probability of

(93)(63)(33)(15/729)3=16800.000008711=0.0146=1.46%\dbinom{9}{3} * \dbinom{6}{3} * \dbinom{3}{3} * (15/729)^3 = 1680 * 0.000008711 = 0.0146 = 1.46\%.

Answer: (3NN)(2NN)(NN)(15/729)N\dbinom{3N}{N} * \dbinom{2N}{N} * \dbinom{N}{N} * (15/729)^N

import random
import numpy as np
from collections import Counter

# PART 2

n = 3

def simulate_trial():
    lst = []
    for i in range(3*n):
        val = np.random.choice(["A", "B", "C"], p=[1/9, 3/9, 5/9])
        lst.append(val)
    return lst

num_successes = 0

# simulate trial 100,000 times
for i in range(100000):
    trial = simulate_trial()
    dict_ = Counter(trial)
    # if each A, B, and C show up exactly 3 times
    if (dict_["A"] == 3 and dict_["B"] == 3 and dict_["C"] == 3):
        num_successes += 1

# expected proportion around 0.0146 or 1.46%
print(num_successes / 100000)