chore(i18n,learn): processed translations (#44866)

This commit is contained in:
camperbot
2022-01-22 20:38:20 +05:30
committed by GitHub
parent d039479e66
commit 43a2a0a395
324 changed files with 2907 additions and 2916 deletions

View File

@ -1,6 +1,6 @@
---
id: 599d15309e88c813a40baf58
title: Entropy
title: エントロピー
challengeType: 5
forumTopicId: 302254
dashedName: entropy
@ -8,53 +8,53 @@ dashedName: entropy
# --description--
Calculate the Shannon entropy H of a given input string.
与えられた入力文字列のシャンエントロピーHを計算します。
Given the discreet random variable $X$ that is a string of $N$ "symbols" (total characters) consisting of $n$ different characters (n=2 for binary), the Shannon entropy of X in bits/symbol is:
$n$ の異なる文字 (2進数でn=2) からなる$N$「シンボル」文字列 (合計文字) である離散確率変数 $X$ の場合、Xのシャンエントロピーをビットシンボルで表すと以下のようになります。
$H_2(X) = -\\sum\_{i=1}^n \\frac{count_i}{N} \\log_2 \\left(\\frac{count_i}{N}\\right)$
where $count_i$ is the count of character $n_i$.
$count_i$ は、文字 $n_i$ の数です。
# --hints--
`entropy` should be a function.
`entropy` という関数です。
```js
assert(typeof entropy === 'function');
```
`entropy("0")` should return `0`
`entropy("0")` `0` を返します。
```js
assert.equal(entropy('0'), 0);
```
`entropy("01")` should return `1`
`entropy("01")` `1` を返します。
```js
assert.equal(entropy('01'), 1);
```
`entropy("0123")` should return `2`
`entropy("0123")` `2` を返します。
```js
assert.equal(entropy('0123'), 2);
```
`entropy("01234567")` should return `3`
`entropy("01234567")` `3` を返します。
```js
assert.equal(entropy('01234567'), 3);
```
`entropy("0123456789abcdef")` should return `4`
`entropy("0123456789abcdef")` `4` を返します。
```js
assert.equal(entropy('0123456789abcdef'), 4);
```
`entropy("1223334444")` should return `1.8464393446710154`
`entropy("1223334444")` `1.8464393446710154` を返します。
```js
assert.equal(entropy('1223334444'), 1.8464393446710154);