2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5900f4b51000cf542c50ffc8
|
|
|
|
|
challengeType: 5
|
|
|
|
|
videoUrl: ''
|
2020-10-01 15:54:21 +00:00
|
|
|
|
title: 问题329:Prime Frog
|
2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
<section id="description">苏珊有一只青蛙。她的青蛙跳过500个正方形,编号为1到500.他只能以相同的概率跳到左边或右边的一个方格,并且他不能超出范围[1; 500]。(如果它落在任何一个结束时,它会在下一步移动时自动跳转到唯一可用的方格。) <p>当他在一个带有素数的正方形上时,他在跳到下一个正方形之前以概率1/3以概率2/3或“N”(不是PRIME)弯曲'P'(PRIME)。当他在一个上面有一个不是素数的数字的正方形时,他会在跳到下一个正方形之前以概率为1/3或'N'以概率2/3歪曲'P'。 </p><p>鉴于青蛙的起始位置是随机的,每个方格具有相同的概率,并且考虑到她听到他的前15个呱呱声,她听到PPPPNNPPPNPPNPN序列的概率是多少? </p><p>以简化形式给出你的答案作为p / q的分数。 </p></section>
|
|
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
|
<section id="instructions">
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
|
|
```yml
|
|
|
|
|
tests:
|
|
|
|
|
- text: <code>euler329()</code>应返回199740353/29386561536000。
|
2020-02-17 16:40:55 +00:00
|
|
|
|
testString: assert.strictEqual(euler329(), 199740353 / 29386561536000);
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
function euler329() {
|
|
|
|
|
// Good luck!
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
euler329();
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|
2020-08-13 15:24:35 +00:00
|
|
|
|
|
|
|
|
|
/section>
|