Data storage and compression
導入済み
15:06
コンピュータが二進数を使う理由
プロセッサの中には数十億の微小なスイッチがあります。それぞれはオンかオフかのいずれかしかできません。これがコンピュータの物理的な全てです—三も七もありません…
英語のナレーション・英語と中国語の字幕を切り替え可能
このレッスンの内容
| English | 意味 |
|---|---|
| Data storage | |
| sound file | |
| Compression/kəmˈpreʃn/ | Representing data using fewer bits; lossless methods preserve all original data, while lossy methods discard some information. |
| bit/bɪt/ | A binary digit, taking the value zero or one. |
| nibble/ˈnɪbl/ | A group of four bits. |
| byte/baɪt/ | A group of eight bits, commonly used as a unit of data storage. |
| kibibyte/ˈkɪbɪbaɪt/ | キビバイト |
| binary/ˈbaɪnəri/ | A number system using base two, with the digits zero and one. |
| colour depth/ˈkʌlə depθ/ | The number of bits used to represent a pixel's colour, determining how many encoded colour values are available. |
| sample rate/ˈsæmpl reɪt/ | |
| sample resolution/ˈsæmpl ˌrezəˈluːʃn/ | |
| bpp | |
| Lossless/ˈlɒsləs/ | Describing compression from which the original data can be recovered exactly. |
| run-length encoding/rʌn leŋθ enˈkəʊdɪŋ/ | ラン長符号化 |
| run/rʌn/ | |
| Lossy/ˈlɒsi/ | Describing compression that discards some original information so it cannot be perfectly recovered. |
| resolution/ˌrezəˈluːʃn/ | Here, the pixel dimensions of a bitmap image, such as its width and height in pixels. |
| program files | |
| Hz | |
| characters/ˈkærɪktəz/ | A text unit such as a letter, digit, punctuation mark or other symbol. |
ファイルを圧縮する
- データストレージは、各ステップが1024倍递增する単位で測られます。
- イメージや音声ファイルのサイズを計算できます。
- 圧縮によってファイルを小さくできます。
ストレージの測定
- ビット(0または1の1つ)・ニブル(4ビット)・バイト(8ビット)。
- 各単位は前の単位の1024倍である($1024 = 2^{10}$のため):キビバイト (KiB) = 1024 バイト、メビバイト (MiB) = 1024 KiB、ギビバイト (GiB) = 1024 MiB、テビバイト (TiB) = 1024 GiB。
- 単位を一つ上へ移動するには常に1024で除算します(1000ではありません)。

コンピュータはすべてのデータを二進数として表現する — 0と1の長い列である。

How many bytes are in 1 kibibyte (KiB)?
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
1 KiB = 1024 bytes (each storage unit steps up by 1024 = 2^10).
Match each storage/compression idea to its meaning.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
File size grows with detail; compression shrinks it, losslessly or lossily.
ファイルサイズの計算
- 画像(ビット)$=$ 幅 × 高さ × カラーディプス。
- 音声(ビット)$=$ サンプルレート × サンプル解像度 × 秒数。
- バイトにするには8で除算し、次にKiBにするには1024で除算し、さらにMiBにするには再度除算します。
- 例:$1024 \times 1024$ × 16 bpp $= 16\,777\,216$ bits $= 2$ MiB。
An image is 100 × 100 pixels with a colour depth of 24 bits. What is its size in bits?
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
width × height × colour depth = 100 × 100 × 24 = 240 000 bits.
コンプレッション
- 可逆圧縮は、ファイルサイズを小さくする際に永久的な情報の損失を伴わないため、元のデータを完全に再構築できます。run-length encoding (RLE) は、連続して繰り返される値を一度だけ記録します(例:
WWWWWWWW→ "8 W")。 - ロシ圧縮では大幅にサイズを小さくするが、永久的にデータを削除する(解像度やサンプルレートを下げる)。
- テキストやプログラムファイルにはロスレスを、写真、音楽、動画にはロシを使用する。

Run-length encodingは、繰り返しの連なりを一度だけ(カウント, 値)のペアとして記録します: 8 W、その後 4 R.

Run-length encoding shrinks repeats
Compression makes a file smaller. Run-length encoding replaces a run of identical values with one value plus a count — lossless, and best when the data has long runs.
Lossless compression:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Lossless keeps all the data (e.g. RLE); lossy permanently discards some.
Run-length encoding (RLE) compresses data by:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
RLE replaces a run like WWWWWWWW with "8 W" — great when data has many repeats.
Lossy compression is most appropriate for:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Lossy suits media where a slight quality loss buys a much smaller file; exact data needs lossless.
このカードは新しいため、翻訳ができるまで英語で表示されます。
Worked example: a sound file, then RLE
A 10-second sound is recorded at 8000 Hz 赫兹 with a sample resolution of 16 bits. Find its size in KiB. Then compress the line WWWWWWBBBW with run-length encoding.
- Multiply, then step up the units:
- RLE stores each run as a count and a value: 6W 3B 1W. Ten characters 字符 become three pairs, and nothing is lost, so this is lossless compression.

An image is 100 pixels wide and 50 pixels high, with a colour depth of 8 bits. What is its size in bytes?
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
$100 \times 50 \times 8 = 40\,000$ bits, and $40\,000 \div 8 = 5000$ bytes.
Which file must be compressed with a lossless method?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
If even one bit of a program changes, it will not run correctly; photos, music and video can lose detail people do not notice.
理解できましたか
- ストレージ単位は1024ずつ増える(KiB, MiB, GiB, TiB)
- 画像サイズ = 幅 × 高さ × カラーディプス(ビット);音声 = レート × 解像度 × 秒数
- ロスレス = 完全復元(RLE);ロシ = サイズ削減だが永久的な損失あり
- テキスト/プログラム用はロスレス、写真/音楽/動画用はロシ
何が問題でしたか?この内容はサイトの運営チームだけが確認します。