1.6 KiB
1.6 KiB
id | challengeType | title | videoUrl | localeTitle |
---|---|---|---|---|
5900f4b51000cf542c50ffc8 | 5 | Problem 329: Prime Frog | 问题329:Prime Frog |
Description
当他在一个带有素数的正方形上时,他在跳到下一个正方形之前以概率1/3以概率2/3或“N”(不是PRIME)弯曲'P'(PRIME)。当他在一个上面有一个不是素数的数字的正方形时,他会在跳到下一个正方形之前以概率为1/3或'N'以概率2/3歪曲'P'。
鉴于青蛙的起始位置是随机的,每个方格具有相同的概率,并且考虑到她听到他的前15个呱呱声,她听到PPPPNNPPPNPPNPN序列的概率是多少?
以简化形式给出你的答案作为p / q的分数。
Instructions
Tests
tests:
- text: <code>euler329()</code>应返回199740353/29386561536000。
testString: 'assert.strictEqual(euler329(), 199740353 / 29386561536000, "<code>euler329()</code> should return 199740353 / 29386561536000.");'
Challenge Seed
function euler329() {
// Good luck!
return true;
}
euler329();
Solution
// solution required