Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

1.5 KiB
Raw Blame History

id, title, challengeType, videoUrl, dashedName
id title challengeType videoUrl dashedName
5900f5221000cf542c510033 问题436不公平的赌注 5 problem-436-unfair-wager

--description--

朱莉向妹妹路易丝提出以下赌注。

她建议他们玩一场机会游戏,以确定谁来洗碗。

对于此游戏他们应使用独立随机数的生成器该生成器均匀分布在0和1之间。

游戏从S = 0开始。

第一个玩家路易丝Louise向生成器添加了S个不同的随机数直到S> 1并记录了她的最后一个随机数'x'。

第二个玩家朱莉继续从生成器中添加S个不同的随机数直到S> 2并记录她的最后一个随机数“ y”。

拥有最高数字的玩家获胜而输家则洗碗如果y> x则第二名玩家获胜。

例如如果第一个玩家抽出0.62和0.44则第一个玩家回合结束因为0.62 + 0.44> 1且x = 0.44。 如果第二名玩家抽出0.1、0.27和0.91则第二名玩家回合结束因为0.62 + 0.44 + 0.1 + 0.27 + 0.91> 2且y = 0.91。 由于y> x第二名玩家获胜。

路易丝考虑了一秒钟,然后反对:“那不公平”。 第二名玩家获胜的概率是多少? 以0.abcdefghij的形式将答案四舍五入到小数点后10位。

--hints--

euler436()应该返回0.5276662759。

assert.strictEqual(euler436(), 0.5276662759);

--seed--

--seed-contents--

function euler436() {

  return true;
}

euler436();

--solutions--

// solution required