Re: [請益] 今天去面試IC設計軟體工程師被打爆的題目
: (2)大樂透的規則是 49 個號碼當中,取 6 個號碼開獎;只要彩券有 3 個以上的號碼與
: 開獎結果相同,就是中獎。依此規則請問:
: a. 最少需買幾張才可以保證中一張?
: b. 概述如何以程式驗證 a.的答案。
其實如果能解出這題的話,可以去MIT當數學教授,
真正的解答還沒有人解出來,
有找到一篇文章,
目前找到的上界為163張,解法如下:
參考請google:Betting Wheels, Lotteries & Lotto Designs
We can get an upper bound by noticing the construction that gives:
L(49,6,6,3) <= L(22,6,3,3) + L(27,6,4,3) <= 77+86 = 163.
Proof: Take any p=6-set out of the 49 elements. Either there are at least 3
elements from the 22 elements and we have one of the 77 blocks intersecting
the 6-set in at least three elements or there are at least 4 elements from
the 27 elements and there is a block intersecting the 6-set in at least 3
elements.
Now LD(22,6,3,3;77) is a well-known combinatorial design and you could not
get a better lotto design.
Whereas LD(27,6,4,3;86) was found by a computer program using a simulated
annealing algorithm. It can probably be improved.
But even if LD(27,6,4,3;86) was the best you could do, there may be better
ways to split the 49 elements or better different constructions.
所以原PO被洗臉別太難過,因為主管連自己也不知道答案
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.250.45.74
推
11/20 21:04, , 1F
11/20 21:04, 1F
推
11/20 21:45, , 2F
11/20 21:45, 2F
→
11/20 21:48, , 3F
11/20 21:48, 3F
→
11/20 21:52, , 4F
11/20 21:52, 4F
→
11/20 21:54, , 5F
11/20 21:54, 5F
→
11/20 21:54, , 6F
11/20 21:54, 6F
→
11/20 21:55, , 7F
11/20 21:55, 7F
→
11/20 21:56, , 8F
11/20 21:56, 8F
→
11/20 21:56, , 9F
11/20 21:56, 9F
→
11/20 22:21, , 10F
11/20 22:21, 10F
推
11/20 22:28, , 11F
11/20 22:28, 11F
→
11/20 22:47, , 12F
11/20 22:47, 12F
推
11/20 23:44, , 13F
11/20 23:44, 13F
→
11/20 23:57, , 14F
11/20 23:57, 14F
推
11/20 23:59, , 15F
11/20 23:59, 15F
推
11/21 00:10, , 16F
11/21 00:10, 16F
推
11/21 00:16, , 17F
11/21 00:16, 17F
推
11/21 00:38, , 18F
11/21 00:38, 18F
推
11/21 01:12, , 19F
11/21 01:12, 19F
→
11/21 01:14, , 20F
11/21 01:14, 20F
推
11/21 09:45, , 21F
11/21 09:45, 21F
→
11/21 09:45, , 22F
11/21 09:45, 22F
→
11/21 09:46, , 23F
11/21 09:46, 23F
→
11/21 21:47, , 24F
11/21 21:47, 24F
→
12/12 13:15, , 25F
12/12 13:15, 25F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 10 之 18 篇):