chore(i18n,learn): processed translations (#45333)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f5021000cf542c510015
|
||||
title: 'Problem 406: Guessing Game'
|
||||
title: 'Problema 406: gioco degli indovinelli'
|
||||
challengeType: 5
|
||||
forumTopicId: 302074
|
||||
dashedName: problem-406-guessing-game
|
||||
@ -8,32 +8,42 @@ dashedName: problem-406-guessing-game
|
||||
|
||||
# --description--
|
||||
|
||||
We are trying to find a hidden number selected from the set of integers {1, 2, ..., n} by asking questions.
|
||||
Stiamo cercando di trovare un numero nascosto selezionato dal set di interi {1, 2, ..., $n$} facendo domande. Per ogni numero (domanda) che chiediamo, otteniamo una di tre possibili risposte:
|
||||
|
||||
Each number (question) we ask, we get one of three possible answers: "Your guess is lower than the hidden number" (and you incur a cost of a), or
|
||||
- "Your guess is lower than the hidden number" (il tuo numero è più piccolo del numero nascosto) (e hai una perdita di a), o
|
||||
- "Your guess is higher than the hidden number" (Il tuo numero è più alto del numero nascosto) (e hai una perdita di b), o
|
||||
- "Yes, that's it!" (Sì, è quello!) (e il gioco conclude).
|
||||
|
||||
"Your guess is higher than the hidden number" (and you incur a cost of b), or
|
||||
Dati i valori di $n$, $a$, e $b$, una strategia ottimale minimizza la perdita totale per <u>il peggior caso possibile</u>.
|
||||
|
||||
"Yes, that's it!" (and the game ends).
|
||||
Per esempio, se $n = 5$, $a = 2$, e $b = 3$, allora potremmo iniziare chiedendo "<strong>2</strong>" come prima domanda.
|
||||
|
||||
Given the value of n, a, and b, an optimal strategy minimizes the total cost for the worst possible case.
|
||||
Se ci viene detto che 2 è più grande del numero nascosto, (per una perdita di $b = 3$), allora siamo sicuri che "<strong>1</strong>" è il numero nascosto (per una perdita totale di <strong><span style="color: blue;">3</span></strong>).
|
||||
|
||||
For example, if n = 5, a = 2, and b = 3, then we may begin by asking "2" as our first question.
|
||||
Se ci viene detto che 2 è più basso del numero nascosto (per un costo di $a = 2$), allora la nostra prossima domanda sarà "<strong>4</strong>".
|
||||
|
||||
If we are told that 2 is higher than the hidden number (for a cost of b=3), then we are sure that "1" is the hidden number (for a total cost of 3). If we are told that 2 is lower than the hidden number (for a cost of a=2), then our next question will be "4". If we are told that 4 is higher than the hidden number (for a cost of b=3), then we are sure that "3" is the hidden number (for a total cost of 2+3=5). If we are told that 4 is lower than the hidden number (for a cost of a=2), then we are sure that "5" is the hidden number (for a total cost of 2+2=4). Thus, the worst-case cost achieved by this strategy is 5. It can also be shown that this is the lowest worst-case cost that can be achieved. So, in fact, we have just described an optimal strategy for the given values of n, a, and b.
|
||||
Se ci viene detto che 4 è più alto del numero nascosto (per un costo di $b 0 3$), allora siamo sicuri che "<strong>3</strong>" è il numero nascosto (per un costo totale di $2 + 3 \color{blue}{\mathbf{5}}$).
|
||||
|
||||
Let C(n, a, b) be the worst-case cost achieved by an optimal strategy for the given values of n, a, and b.
|
||||
Se ci viene detto che 4 è più basso del numero nascosto (per un costo di $a = 2$), allora siamo sicuri che "<strong>5</strong>" è il numero nascosto (per un costo totale di $2 + 2 = \color{blue}{\mathbf{4}}$).
|
||||
|
||||
Here are a few examples: C(5, 2, 3) = 5 C(500, √2, √3) = 13.22073197... C(20000, 5, 7) = 82 C(2000000, √5, √7) = 49.63755955...
|
||||
Quindi, per lo scenario peggiore, il costo ottenuto con questa strategia è <strong><span style="color: red">5</span></strong>. Si può anche mostrare che questo è il più basso costo per il peggior scenario ceh può essere ottenuto. Quindi, infatti, abbiamo apena descritto una strategia ottimale per i valori dati di $n$, $a$, e $b$.
|
||||
|
||||
Let Fk be the Fibonacci numbers: Fk = Fk-1 + Fk-2 with base cases F1 = F2 = 1.Find ∑1≤k≤30 C(1012, √k, √Fk), and give your answer rounded to 8 decimal places behind the decimal point.
|
||||
Sia $C(n, a, b)$ il costo per il peggio scenario ottenuto da una strategia ottimale per i dati valori di $n$, $a$, e $b$.
|
||||
|
||||
Ecco alcuni esempi:
|
||||
|
||||
$$\begin{align} & C(5, 2, 3) = 5 \\\\ & C(500, \sqrt{2}, \sqrt{3}) = 13.220\\,731\\,97\ldots \\\\ & C(20\\,000, 5, 7) = 82 \\\\ & C(2\\,000\\,000, √5, √7) = 49.637\\,559\\,55\ldots \\\\ \end{align}$$
|
||||
|
||||
Siano $F_k$ i numeri di Fibonacci: $F_k = F_{k - 1} + F_{k - 2}$ con i casi base $F_1 = F_2 = 1$.
|
||||
|
||||
Trova $\displaystyle\sum_{k = 1}^{30} C({10}^{12}, \sqrt{k}, \sqrt{F_k})$, e dai la tua risposta arrotondata a 8 decimali dietro il punto.
|
||||
|
||||
# --hints--
|
||||
|
||||
`euler406()` should return 36813.12757207.
|
||||
`guessingGame()` dovrebbe restituire `36813.12757207`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler406(), 36813.12757207);
|
||||
assert.strictEqual(guessingGame(), 36813.12757207);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@ -41,12 +51,12 @@ assert.strictEqual(euler406(), 36813.12757207);
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler406() {
|
||||
function guessingGame() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
euler406();
|
||||
guessingGame();
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
Reference in New Issue
Block a user