如果股票 XYZ 在任何一天上涨的概率是 50%。它在 6 天中恰好有 4 天上涨的概率是多少?
If the probability of stock XYZ going up on any one day is 50%. What is the probability that it goes up exactly 4 out of 6 days?
我无法回答这些问题。对我来说已经有一段时间了,我不确定从哪里开始。
如果股票XYZ在任何一天上涨的概率是50%。 6 天中恰好有 4 天上涨的概率是多少?
如果股票XYZ在任何一天下跌的概率是30%。它在 6 天中正好有 3 天下降的概率是多少
我会给你我对 B 的最佳猜测。这可能会回答 A。
B -
6C3 * .3^3 * .7^3 = 18.52%
一个-
6C4 * .5^4*.5^2 = 23.4%?
但是我还是不知道
测试您的计算相当容易,尤其是第一种情况,概率正好是 50%。算出所有时间范围内的可能性:
1 2 3 4 5 6
------ ------ ------ ------ ------ ------
not-up not-up not-up not-up not-up not-up
not-up not-up not-up not-up not-up up
not-up not-up not-up not-up up not-up
not-up not-up not-up not-up up up
:
up up up up up not-up
up up up up up up
现在算出其中有多少 正好 四个 up
事件。将其除以总数,你就有了,它,你所追求的机会(在零和一之间,显然乘以一百得到百分比)。
由于这是一个编程站点而不是 math/combinatorics/probability 站点,这里有一些示例(相当原始)Python 代码可以为您解决:
outcomes = ['F','T']
total = 0
selection = 0
for day1 in outcomes:
for day2 in outcomes:
for day3 in outcomes:
for day4 in outcomes:
for day5 in outcomes:
for day6 in outcomes:
total += 1
trues = 0
if day1 == 'T': trues += 1
if day2 == 'T': trues += 1
if day3 == 'T': trues += 1
if day4 == 'T': trues += 1
if day5 == 'T': trues += 1
if day6 == 'T': trues += 1
if trues == 4: selection += 1
print('Probability is', selections, '/', total, 'or', 100 * selections / total, '%')
显示 15/64, 23.4375%
,与您的计算结果相符。
第二部分稍微复杂一些,但只需修改 30%/天可能性的结果,并检查三天而不是四天即可完成:
outcomes = ['T', 'T', 'T', 'F', 'F', 'F', 'F', 'F', 'F', 'F']
:
if trues == 3: selections += 1
得到 185220/1000000, 18.522%
再次符合您的计算。
我无法回答这些问题。对我来说已经有一段时间了,我不确定从哪里开始。
如果股票XYZ在任何一天上涨的概率是50%。 6 天中恰好有 4 天上涨的概率是多少?
如果股票XYZ在任何一天下跌的概率是30%。它在 6 天中正好有 3 天下降的概率是多少
我会给你我对 B 的最佳猜测。这可能会回答 A。
B - 6C3 * .3^3 * .7^3 = 18.52%
一个- 6C4 * .5^4*.5^2 = 23.4%?
但是我还是不知道
测试您的计算相当容易,尤其是第一种情况,概率正好是 50%。算出所有时间范围内的可能性:
1 2 3 4 5 6
------ ------ ------ ------ ------ ------
not-up not-up not-up not-up not-up not-up
not-up not-up not-up not-up not-up up
not-up not-up not-up not-up up not-up
not-up not-up not-up not-up up up
:
up up up up up not-up
up up up up up up
现在算出其中有多少 正好 四个 up
事件。将其除以总数,你就有了,它,你所追求的机会(在零和一之间,显然乘以一百得到百分比)。
由于这是一个编程站点而不是 math/combinatorics/probability 站点,这里有一些示例(相当原始)Python 代码可以为您解决:
outcomes = ['F','T']
total = 0
selection = 0
for day1 in outcomes:
for day2 in outcomes:
for day3 in outcomes:
for day4 in outcomes:
for day5 in outcomes:
for day6 in outcomes:
total += 1
trues = 0
if day1 == 'T': trues += 1
if day2 == 'T': trues += 1
if day3 == 'T': trues += 1
if day4 == 'T': trues += 1
if day5 == 'T': trues += 1
if day6 == 'T': trues += 1
if trues == 4: selection += 1
print('Probability is', selections, '/', total, 'or', 100 * selections / total, '%')
显示 15/64, 23.4375%
,与您的计算结果相符。
第二部分稍微复杂一些,但只需修改 30%/天可能性的结果,并检查三天而不是四天即可完成:
outcomes = ['T', 'T', 'T', 'F', 'F', 'F', 'F', 'F', 'F', 'F']
:
if trues == 3: selections += 1
得到 185220/1000000, 18.522%
再次符合您的计算。