总有些出人意料的数学题,目的就是为了测试和提升人的智力极限。
下面这12个简单的数学题,在学生中引起了巨大的争议,但却都是无可争辩的事实。
他们都具有悖论和概率的特性,而且总是能引起一些争论。
如果你想通过数学的方法来打动朋友或迷惑敌人的话,那就往下看吧。
Read full article from 译言精选-最具争议的12个数学事实
总有些出人意料的数学题,目的就是为了测试和提升人的智力极限。
下面这12个简单的数学题,在学生中引起了巨大的争议,但却都是无可争辩的事实。
他们都具有悖论和概率的特性,而且总是能引起一些争论。
如果你想通过数学的方法来打动朋友或迷惑敌人的话,那就往下看吧。
Read full article from 译言精选-最具争议的12个数学事实
在第三章"概率计算的一般原则"最后提到一个日出问题:
如果我们不了解太阳运行的基本规则,根据统计,在过去的N天里,太阳每天都正常升起。那么,太阳明天照常升起的概率是多少呢?
拉普拉斯在书中,指出蒲丰在著作《政治算术》中的结果 1 - (1/2) ^ N 是错误的。
正确的结果应该是 (N + 1) / (N + 2) 。 下面, 我尝试推导了一下。
推导过程,应用到第三章中提交的一些概率计算原则:
1. 第六个原则: 假定我们观测到一个经常发生的事件, 每一个被认为是导致它的原因成立的可能性被这个事件发生的概率显示。于是某一原因成立的概率是一个分数,其分子是这个原因导致此事件的概率, 而其分母是所有各原因的类似概率的和; 如果这些不同的原因被事先考虑为不是等可能时,就必须将由每个导致此事件的原因的概率代之以它与此原因本身的可能性的乘积。这就是由事件到原因的机会分析这一分支的基本原则。
2. 第七个原则: 将来的事件发生的概率是,所有引起被观测事件的原因发生的概率乘以在此原因下该事件发生的概率的乘积之和。
在我们这个问题中,
1. 观察到的现象(事件)为:过去的N天里太阳每天升起。 记为 Observation
2. 将来要估计的事件为: 明天太阳升起的概率。 记为Prediction
其实,我们希望求出 P(Prediction | Observation).
我们了解的背景知识不多, 太阳升起的概率假设为p, p是0到1之间任意一个值。 根据上面两条计算原则, 可以如下推导出答案:
Read full article from 明天太阳照常升起的概率是多少?
只是记录一下遇到的几道抛硬币的概率问题。
1、平均需要抛掷多少次硬币,才会首次出现连续的两个正面?
假设连续两个正面的期望是E,那么,先看第一次抛硬币:
于是可以得到如下关系式:
E = 0.5(E+1) + 0.25*2 + 0.25(E+2)
得到所求期望E=6
现在把题目拓展,不是说"连续两个正面",而是"连续n个正面"呢?
这个问题Matrix67有非常有趣的解答《用数学解赌博问题不稀奇,用赌博解数学问题才牛B》,下面我简述一下:
假设有一个赌场,赌博的方式就是猜正反,每来一个玩家来的时候都只带了1元,每次都会全部下注,然后赌正面,庄家抛硬币,如果猜错就是全部输掉,如果赢了就得到下注的两倍,玩家会一直玩一直玩直到钱输光;而赌场老板会看,如果有人赢到2^n元,就下令关闭赌场。
于是直到n次正面朝上的情况发生,赌场关闭,只有最后那n个人才赚到了钱,最后一人得到了2元(没算成本价1元),倒数第二人是4元……倒数第n人是2^n元,所以,一共得到(等比数列求和):
2+4+8+…+2^n = 2*(1-2^n)/(1-2) = 2^(n+1) �C 2
赌场有多少钱流入,自然就有多少钱流出,所以到赌场倒闭,玩家赢得的钱的总数,就应该等于赌场期望的收入。而因为每个人来的时候都只带了1元,因此这个数正好等于期望的人数。于是这就是最终答案。
2、一堆硬币,每天都随便捡一枚抛,如果抛到正面,就把它翻过来;如果抛到反面,就再抛一下,问很长很长时间以后,硬币正面和反面的比例会趋近于多少?
假设正面的比例是x,那么反面就是1-x,对于任意一次操作:
所以得到正面的综合起来的概率为:
x*0 + (1-x)*0.5 = x
所以x = 1/3,因此硬币正面和反面的比例会趋近于x/(1-x) = 1/2
3、连续抛硬币,直到第一次出现连续两次正面为止,恰好抛了N次的概率是多少?
考虑"恰好"抛N次硬币,到底有多少种情况可以得出最后两次是连续出现了正面,而之前没有出现过连续正面。
所以f(1)=f(2)=0,g(1)=0,g(2)=1,而当x>2,
于是得到:
f(x+2)=f(x+1)+g(x+1)=f(x+1)+f(x)
g(x+1)=f(x)
其中,求f(x)的递推式可以看出f(x)是斐波那契数列,根据它的通项公式:
得到f(N),也就得到了g(N),而总抛的可能性共有2^N次方,因此,概率为:
(f(N)+g(N))/2^N
4、抛硬币N次,出现连续M次正面的概率是多少?
这个问题也很常见,但是做起来没那么容易,这里有一个非常详细的讨论过程(链接),我就不搬过来了。
5、抛N次硬币,正反两面出现次数相同的概率是多少?
其实就是从N个硬币的空位中,选出N/2个作为正面,余下N/2个作为反面,应用组合公式可得到:
C(N,N/2)/2^N=N!/((N-N/2)!(N/2)!)/2^N
继续,
正面出现次数超过反面的概率?
因为正反情况相同,因此正面次数超过反面的概率应当等于反面次数超过正面的概率,因此结果为1减去上面那一问的结果之后除以2:
(1-C(N,N/2)/2^N)/2
Read full article from 几道抛硬币问题 | 四火的唠叨
智力题以及概率题 - Backyard of LixinZhang
G,E,A,B,C,D,F
Read full article from 智力题以及概率题 - Backyard of LixinZhang
.[1] For example, when n = 50 it takes about 225[2] trials to collect all 50 coupons.1 1.0
2 3.0
3 5.5
4 8.33333333333
5 11.4166666667
6 14.7
7 18.15
8 21.7428571429
9 25.4607142857
10 29.2896825397
11 33.2186507937
12 37.2385281385
13 41.3417388167
14 45.5218725719
15 49.7734348984
16 54.0916638917
17 58.4723928849
18 62.9119454075
19 67.4070534857
20 71.9547931429
21 76.5525328
22 81.1978915048
23 85.888704755
24 90.6229962661
25 95.3989544438
26 100.214912622
27 105.069332338
28 109.960789091
29 114.88796013
30 119.849613928
31 124.844601059
32 129.871846254
33 134.930341449
34 140.019139675
35 145.137349666
36 150.284131085
37 155.458690281
38 160.660276505
39 165.888178519
40 171.141721557
41 176.420264596
42 181.723197879
43 187.049940686
44 192.399939306
45 197.7726652
46 203.167613315
47 208.584300561
48 214.022264403
49 219.481061578
50 224.960266916
51 230.459472255
52 235.978285436
53 241.516329387
54 247.073241262
55 252.648671656
56 258.242283868
57 263.853753223
58 269.482766437
59 275.129021031
60 280.792224777
61 286.47209519
62 292.168359046
63 297.880751933
64 303.609017837
65 309.352908741
66 315.11218426
67 320.886611294
68 326.675963702
69 332.480021991
70 338.298573035
71 344.131409792
72 349.978331057
73 355.839141211
74 361.713649994
75 367.601672291
76 373.503027922
77 379.417541447
78 385.345041986
79 391.285363037
80 397.238342316
81 403.203821595
82 409.181646553
83 415.171666632
84 421.173734905
85 427.18770794
86 433.21344568
87 439.250811328
88 445.299671228
89 451.359894765
90 457.431354256
91 463.513924859
92 469.607484473
93 475.711913652
94 481.827095519
95 487.952915684
96 494.089262165
97 500.236025313
98 506.393097739
99 512.560374246
100 518.737751764
101 524.925129282
102 531.122407789
103 537.329490219
104 543.546281386
105 549.772687938
106 556.008618299
107 562.253982622
108 568.50869274
109 574.772662118
110 581.045805807
111 587.328040405
112 593.619284012
113 599.919456191
114 606.228477927
115 612.546271593
116 618.872760911
117 625.207870919
118 631.551527936
119 637.903659528


Puzzles, Maths and Algorithms: Innocents and Criminals: Finding Minority Entity
Read full article from Puzzles, Maths and Algorithms: Innocents and Criminals: Finding Minority Entity
Puzzles, Maths and Algorithms: Math Magician
A magician has one hundred cards numbered 1 to 100. He puts them into three boxes, a red one, a white one and a blue one, such that each box contains atleast one card. A member of audience draws two cards from two different boxes and announces the sum of the number on those cards. Given this information magician locates the box from which no card has been drawn. How many ways are there to put the cards in the boxes so that the trick works.Read full article from Puzzles, Maths and Algorithms: Math Magician
Puzzles, Maths and Algorithms: Number and Age of David's Kids
Problem: The product of the ages of David's children is the square of the sum of their ages. David has less than eight children. None of his children have the same age. None of his children is more than 14 years old. All of his children is at least two years old. How many children does David have, and what are their ages?Read full article from Puzzles, Maths and Algorithms: Number and Age of David's Kids
Lets define an event, E as tossing the biased coin twice. The possible outcomes with probabilities is as follows
Let expected coin toss be e.
Probability that we get outcome in 1st event is 2x(1-x)
Total number of coin toss would be 2
Probability that we get no outcome in 1st event is [1 - 2x(1-x)]
Total number of coin toss would be 2 + e (we wasted 2 coin toss and still we expect e)
==> e = 2 * 2x(1-x) + (2+e) * [1 - 2x(1-x)]
==> e = 4x(1-x) + 2 - 4x(1-x) + e - 2ex(1-x)
==> e = 1/ [x(1-x)]
so for x = 1/2, e = 4
for x=2/3, e = 4.5
for x=1, e = INF (as expected, because all we get is chain of h h h h h)
p = prob of e heads + prob of e tail
==> p = x^e + (1-x)^e
To find a bound on this p in polynomial terms can be done by using binomial expansion and Newtonian series is out of the scope of this blog. But some number crunching is.
For x = 1/2, e = 4, p = 0.125
For x = 2/3, e = 4.5, p = 0.168
For x = 3/4, e = 5.33, p = 0.216
For x = 0.99, e = 101, p = 0.362
This tells us that probability that outcome comes is quite good even for high coin biases.
In above method, we say that HT or TH terminates experiment. and continue the experiment a fresh when the outcome is HH or TT.
We can further combine outcome of two such events to increase the probability of outcome e.g. say HH TT => heads and TT HH means tails.
from random import random
def prob2():
niter = 100000
n, ntri, nrtri = 0.0, 0, 0
lsmall, llarge, lmid, lcenter = 0, 0, 0, 0
while n < niter:
n += 1
p = random()
q = random()
x = min(p, q)
y = max(p, q)
l1 = x
l2 = y-x
l3 = 1-y
mn = min(l1, l2, l3)
mx = max(l1, l2, l3)
md = 1 - mn - mx
lsmall += mn
llarge += mx
lmid += md
lcenter += y
if l1 + l2 > l3 and l1 + l3 > l2 and l2 + l3 > l1:
ntri += 1
if mn**2 + md**2 == mx**2:
nrtri += 1
print 'min len:', lsmall/n
print 'max len:', llarge/n
print 'mid len:', lmid/n
print 'center stick len', lcenter/n
print 'triangle prob:', ntri/float(n)
print 'right triangle prob:', nrtri/float(n)
def prob3():
niter = 100000
n, ntri, nrtri = 0.0, 0, 0
lsmall, llarge, lmid, lcenter = 0, 0, 0, 0
while n < niter:
n += 1
p = random()
q = random()
l1 = 0.5 * (1-p)
l2 = 0.25 * (1+p) * (1-q)
l3 = 0.25 * (1+p) * (1+q)
mn = min(l1, l2, l3)
mx = max(l1, l2, l3)
md = 1 - mn - mx
lsmall += mn
llarge += mx
lmid += md
lcenter += (l2+l3)/2
if l1 + l2 > l3 and l1 + l3 > l2 and l2 + l3 > l1:
ntri += 1
if mn**2 + md**2 == mx**2:
nrtri += 1
print 'min len:', lsmall/n
print 'max len:', llarge/n
print 'mid len:', lmid/n
print 'center stick len', lcenter/n
print 'triangle prob:', ntri/float(n)
print 'right triangle prob:', nrtri/float(n)
Read full article from Puzzles, Maths and Algorithms: Stick BreakingProbability Puzzle - PrismoSkills
Puzzle: If the probability of observing a car in 20 minutes on a highway is 609/625, what is the probability of observing a car in 5 minutes (assuming constant default probability)?Read full article from Probability Puzzle - PrismoSkills
选择爱人的数学方法(经典秘书问题) - tenos - 博客园
Kepler(开普勒,1571年12月27日-1630年11月15日),德国天文学家、数学家,十七世纪科学革命的关键人物。
这样一位伟大的人物在1611年遇到一个问题,他的夫人患匈牙利斑疹伤寒(Hungarian spotted feve)过世,为了照顾孩子、打理家务,Kepler 需要重新寻找一位夫人。身为严谨的科学家,他认真记录下了"面试"11位夫人"候选人"的过程。
第一位,"口臭",Kepler写到。
第二位,"养尊处优"。
第三位:"已经许配给一个有私生子的人,太复杂了"。
第四位:"身材高挑,气质不凡"。
不过,Kepler 想看看第五个,因为有人告诉他,第五位女孩儿集"谦虚、节俭、勤奋..."等优点于一身。于是,Kepler 犹豫了,而且犹豫了很长时间,以至于第四位和第五位女孩儿都不耐烦地离开了。
第六位是一个"衣着华丽的大小姐",这把Kepler吓了一跳,他有点担心高昂的婚礼费用。
第七位女孩儿很迷人,Kepler 也很喜欢她。由于没看完这11位"候选人",Kepler 心有不甘。他让这位女孩儿等他看完"候选人"再做决定。不愿意等人的第七位女孩儿也离开了。
第八位女孩儿,Kepler 没怎么关心。
第九位女孩儿"体弱多病";第十位女孩儿有着"对于没什么要求的普通人"也没办法接受的体型;最后一位女孩儿,还是个小姑娘,也不适合。
11位"候选人"都看完了,一个也没有约成。Kepler 开始想,哪里出错了?
Kepler 所需要的,是优化策略,一种不能保证成功但能将失望降至最低的方法。数学家们觉得,我们能算出这样的公式来。 本文地址
如果你有自己的候选列表,爱人也好,约会也好,工作也好,这方法都管用。规则很简单:只要你的选择有限,你可以做一个列表,然后挨个来。再一次声明,不总能成功。但对数学家来说,足够了。
这个问题甚至有个名字:(开普勒的)婚姻问题。后来,又被衍生为经典秘书问题(Classic Secretary Problem)。比如,你有20个候选人要逐一面试,在面试之后,你必须决定要不要。要,选择结束;不要,那就喊下一位。不能回头。一旦决定聘用,问题结束。
根据马丁・加德纳在1960年的说法,最好的办法是,先面试前36.8%的候选人,但不录用他们。在此之后,一旦遇到比前面这36.8%里最好的还好的,立马录用。
为什么是36.8%呢?这个答案牵扯到e,1/e=0.368(关于这个概率的证明可以参考 维基百科)。很显然,这个公式经过了无数次的验证。尽管它不能保证结果最优,但你有36.8%的机会。对于11个"候选人"来说已经足够了。
如果,当时Kepler 用了这个公式,会怎样呢?11的36.8%的是4,所以他要pass掉前四位候选人,从第五位开始,只要比前四位好,Kepler 就应该求婚。也就是,经过一番折腾后,Kepler 会和第五位女孩儿结婚。(你还见记得第五位是谁吗?)
如果Kepler 当时知道这个公式(这也是当今数学上最优停止的一个例子),他便能省去后后面一批人的约会了。
Read full article from 选择爱人的数学方法(经典秘书问题) - tenos - 博客园
Lazy caterer's sequence - Wikipedia, the free encyclopedia
The lazy caterer's sequence, more formally known as the central polygonal numbers, describes the maximum number of pieces of a circle (a pancake or pizza is usually used to describe the situation) that can be made with a given number of straight cuts. For example, three cuts across a pancake will produce six pieces if the cuts all meet at a common point, but seven if they do not. This problem can be formalized mathematically as one of counting the cells in an arrangement of lines; for generalizations to higher dimensions, see arrangement of hyperplanes.
Read full article from Lazy caterer's sequence - Wikipedia, the free encyclopedia
| i×j | = | k = - j×i | |
| j×k | = | i = - k×j | |
| k×i | = | j = - i×k |
| i×i = j×j = k×k = 0 |
| u×v = ab(i×j) = ab k |
| | u×v| = | u|| v| sinθ |
| u×v = (u 1 v 2 - u 2 v 1)k + (u 3 v 1 - u 1 v 3)j + (u 2 v 3 - u 3 v 2)i |
| The symbol is usually a lowercase letter with a "hat", such as: |
| (Pronounced "a-hat") |