fix(curriculum): clean-up Project Euler 381-400 (#43024)

* fix: clean-up Project Euler 381-400

* fix: missing image extension

* fix: missing subscripts

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
gikf
2021-07-30 16:59:29 +02:00
committed by GitHub
parent 594adf02c1
commit d269909faa
20 changed files with 279 additions and 180 deletions

View File

@ -8,18 +8,18 @@ dashedName: problem-398-cutting-rope
# --description--
Inside a rope of length n, n-1 points are placed with distance 1 from each other and from the endpoints. Among these points, we choose m-1 points at random and cut the rope at these points to create m segments.
Inside a rope of length $n$, $n - 1$ points are placed with distance 1 from each other and from the endpoints. Among these points, we choose $m - 1$ points at random and cut the rope at these points to create $m$ segments.
Let E(n, m) be the expected length of the second-shortest segment. For example, E(3, 2) = 2 and E(8, 3) = 16/7. Note that if multiple segments have the same shortest length the length of the second-shortest segment is defined as the same as the shortest length.
Let $E(n, m)$ be the expected length of the second-shortest segment. For example, $E(3, 2) = 2$ and $E(8, 3) = \frac{16}{7}$. Note that if multiple segments have the same shortest length the length of the second-shortest segment is defined as the same as the shortest length.
Find E(107, 100). Give your answer rounded to 5 decimal places behind the decimal point.
Find $E({10}^7, 100)$. Give your answer rounded to 5 decimal places behind the decimal point.
# --hints--
`euler398()` should return 2010.59096.
`cuttingRope()` should return `2010.59096`.
```js
assert.strictEqual(euler398(), 2010.59096);
assert.strictEqual(cuttingRope(), 2010.59096);
```
# --seed--
@ -27,12 +27,12 @@ assert.strictEqual(euler398(), 2010.59096);
## --seed-contents--
```js
function euler398() {
function cuttingRope() {
return true;
}
euler398();
cuttingRope();
```
# --solutions--