2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
id: 5900f45d1000cf542c50ff6f
|
|
|
|
title: 'Problem 240: Top Dice'
|
2020-11-27 18:02:05 +00:00
|
|
|
challengeType: 5
|
2019-08-05 16:17:33 +00:00
|
|
|
forumTopicId: 301887
|
2021-01-13 02:31:00 +00:00
|
|
|
dashedName: problem-240-top-dice
|
2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --description--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
There are 1111 ways in which five 6-sided dice (sides numbered 1 to 6) can be rolled so that the top three sum to 15. Some examples are:
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-15 12:26:34 +00:00
|
|
|
$$\begin{align}
|
|
|
|
& D_1,D_2,D_3,D_4,D_5 = 4,3,6,3,5 \\\\
|
|
|
|
& D_1,D_2,D_3,D_4,D_5 = 4,3,3,5,6 \\\\
|
|
|
|
& D_1,D_2,D_3,D_4,D_5 = 3,3,3,6,6 \\\\
|
|
|
|
& D_1,D_2,D_3,D_4,D_5 = 6,6,3,3,3
|
|
|
|
\end{align}$$
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
In how many ways can twenty 12-sided dice (sides numbered 1 to 12) be rolled so that the top ten sum to 70?
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --hints--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-15 12:26:34 +00:00
|
|
|
`topDice()` should return `7448717393364182000`.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
```js
|
2021-07-15 12:26:34 +00:00
|
|
|
assert.strictEqual(topDice(), 7448717393364182000);
|
2018-09-30 22:01:58 +00:00
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --seed--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
## --seed-contents--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
2021-07-15 12:26:34 +00:00
|
|
|
function topDice() {
|
2020-09-15 16:57:40 +00:00
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-07-15 12:26:34 +00:00
|
|
|
topDice();
|
2018-09-30 22:01:58 +00:00
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --solutions--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|