# 文心一言 VS 讯飞星火 VS chatgpt （30）-- 算法导论5.2 2题

## 文心一言：

0.75×0.75×2=1.125

## 讯飞星火：

``````python
import math
# 假设有10个应聘者，我们想雇用2个不同的应聘者
n = 10
# 计算组合数 C(n,2)
c = math.comb(n, 2)
# 计算总的可能事件数 n^n
n_squared = n**2
# 计算恰好雇用两次的概率 P(A)
p = c / n_squared
print("The probability of hiring two different candidates in HIRE-ASSISTANT is:", p)
``````

## 360智脑：

• 你选择了两个成功应聘者的组合。这种情况的概率是 np(1-p)^k。

• 你选择了一个失败和一个成功应聘者的组合。这种情况的概率是 (n-2)p^2 * (1-p)^(n-3)。

## chatglm：

P(2, 2) = (1/n) * (1/n) * (p_1^2 + p_2^2 + … + p_n^2)

P(2, 2) = (1/n) * (1/n) * (p_1^2 + p_2^2 + … + p_n^2)
= (1/n) * (1/n) * (1 - (1/n) * (1/n) * (p_1^2 + p_2^2 + … + p_n^2))
= (1/n) * (1/n) * (1 - (1/n)^2 * (p_1^2 + p_2^2 + … + p_n^2))
= (1/n) * (1/n) * (1 - (1/n)^2 * (n(p_1 + p_2 + … + p_n) - 1))
= (1/n) * (1/n) * (1 - (1/n)^2 * (n
(n-1)p_n + n(n-2)p_{n-1} + … + 2p_1 + p_0))
= (1/n) * (1/n) * (1 - (1/n)^2 * (n
(n-1)p_n + n*(n-2)p_{n-1} + … + 2p_1 + p_0))
= (1/n) * (1/n) * (1 - (1/n)^2 * np_n)
= (1/n) * (1/n) * (1 - (1/n)^2 * np_n)
= (1/n) * (1/n) * (1 - np_n)
= (1/n) * (1/n) * (1 - np_n)
= (1/n) * (1/n) * (1 - np_n)
= (1/n) * (1/n) * (1 - np_n)
= (1/n) * (1/n) * (1 - np_n)
= (1/n) * (1/n) * (1 - np_n)
= 1 - np_n

P(2, 2) = (1/n) * (1/n) * (1 - np_n)
= (1/n) * (1/n) * (1 - np_n)
= (1/n) * (1/n) * (1 - np_n)
= (1/n) * (1/n) * (1 - np_n)
= 1 - np_n

(=￣ω￣=)··· 暂无内容！

416

17

35

20