I built a QR code with my bare hands to see how it works

Veritasium
Subtitle size
Unseen 1152Looked up 0Learning 0Mastered 0

When QR codes first came out, I thought they were awful, never going to catch on.QRコードが最初に登場したとき、私はひどいものだと思いました、決して普及しないだろうと。

This is a flowchart from the time that really resonated with me.これは当時のフローチャートで、私に本当に響いたものです。

The problem, as I saw it, was that QR codes are ugly and they mean nothing to people.私が考える問題は、QRコードは見た目が悪く、人々にとって何の意味もないということでした。

I would rather just see a website or a word that I could Google.ググれるウェブサイトや単語をただ見たいと思っていました。

QR codes are a language for machines, and I am a human.QRコードは機械のための言語であり、私は人間です。

But I was wrong.しかし私は間違っていました。

QR codes obviously turned out to be so useful that they are now ubiquitous, used in everything from tickets to restaurant menus and advertising.QRコードは明らかに非常に便利であることが判明し、今では至る所にあり、チケットからレストランのメニューや広告まであらゆるものに使われています。

In some countries, they're the most common way to exchange money.一部の国では、お金をやり取りする最も一般的な方法になっています。

And the story of QR codes is a very human one.そしてQRコードの物語は、とても人間的なものです。

The origin of these checkerboard patterns actually dates back to our first efforts at digitizing information.これらの市松模様の起源は、実は情報をデジタル化しようとした最初の取り組みにまで遡ります。

In 1825, there was a renowned painter who lived in New Haven, Connecticut, with his wife and two kids.1825年、コネチカット州ニューヘイブンに妻と二人の子供と暮らす有名な画家がいました。

His big break came one day when he was invited to paint a portrait of the Marquis de Lafayette, a hero of the American Revolution.ある日、アメリカ独立戦争の英雄であるラファイエット侯爵の肖像画を描くよう依頼され、彼に大きな転機が訪れました。

Even though his wife was expecting their third child any day, the opportunity was too good to pass up, and he hastily set off for Washington D.C. where Lafayette was waiting.妻がいつ三人目の子供を出産してもおかしくない状況だったにもかかわらず、その機会は見逃すには惜しすぎて、彼はラファイエットが待つワシントンD.C.へ急いで出発しました。

There, the painter wrote to his wife describing his first meeting with Lafayette, signing off with the words, "Will write again soon.そこで画家はラファイエットとの初対面について妻に手紙を書き、「またすぐに手紙を書きます、

Love to all the children.子供たちみんなによろしく、

In the greatest haste, but with the same ardent affection as ever, thy loving husband."大急ぎで書いていますが、これまでと変わらぬ熱い愛情を込めて、君を愛する夫より」という言葉で締めくくりました。

After a few days with no reply, a courier delivered a letter which said his wife was ill after childbirth.数日間返事がないまま、妻が出産後に体調を崩したという手紙が配達人によって届けられました。

Worried, the painter rushed home.心配した画家は急いで家に戻りました。

He traveled by horse and wagon day and night, managing to arrive back in New Haven in several days.彼は馬と馬車で昼夜を問わず移動し、数日でニューヘイブンに戻ることができました。

But it was far too late.しかし、あまりにも遅すぎました。

His wife had died.彼の妻は亡くなっていました。

Not only that, he had missed the funeral.それだけでなく、彼は葬儀にも間に合いませんでした。

Her body was already buried in the ground.彼女の遺体はすでに土の中に埋められていました。

The painter's name was Samuel Finley Breese Morse.その画家の名前はサミュエル・フィンリー・ブリーズ・モースでした。

From that day forward, Morse set out to find a faster way to communicate over long distances.その日から、モースは長距離をより速く通信する方法を探し求めるようになりました。

He got a job at New York University, where he attended lectures on electricity, a rapidly developing field at the time.彼はニューヨーク大学で職を得て、そこで当時急速に発展していた分野である電気に関する講義に出席しました。

In 1836, along with Joseph Henry and Alfred Vail, he devised a machine that could send electrical pulses along a wire.1836年、ジョセフ・ヘンリーやアルフレッド・ヴェイルと共に、彼は電線に沿って電気パルスを送ることができる機械を考案しました。

This was not the first electric telegraph, but it was the simplest.これは最初の電気電信ではありませんでしたが、最もシンプルなものでした。

In the UK, another team had set up a series of circuits to move five magnetic needles to point at letters and numbers.イギリスでは、別のチームが5本の磁針を動かして文字や数字を指し示すための一連の回路を設置していました。

Morse's system required only a single circuit, but the simplicity of the apparatus demanded a cleverer method of encoding information.モールスのシステムは単一の回路だけを必要としましたが、装置の単純さゆえに情報を符号化するためのより巧妙な方法が求められました。

On the circuit, you could send short or long pulses.その回路では、短いパルスや長いパルスを送ることができました。

Morse turned these into dots and dashes.モールスはこれらをドットとダッシュに変えました。

The most common letters could be sent with a single key press, a dot for an E and a dash for a T.最も一般的な文字は1回のキー操作で送ることができ、Eはドット、Tはダッシュでした。

The other letters were arranged by frequency and assigned increasingly complex codes.他の文字は頻度順に並べられ、次第に複雑な符号が割り当てられました。

These symbols were meant to be printed at the receiver on a paper strip, but operators soon realized they could recognize the letters just by the sound.これらの記号は受信機で紙テープに印刷されることを意図していましたが、通信士たちはすぐに音だけで文字を認識できることに気づきました。

This sped up the rate at which information could be sent and received, so Morse code became an international standard for rapid messaging.これにより情報の送受信速度が上がり、モールス信号は迅速なメッセージ伝達の国際標準となりました。

Widely used in the military, maritime communications, and aviation, the universally recognized distress call SOS.軍事、海事通信、航空で広く使われ、世界的に認識されている遭難信号SOS。

What does it stand for?それは何の略なのでしょうか?

Nothing.何でもありません。

It just happens to be easy to send and recognized in Morse code.それは単にモールス信号で送りやすく認識しやすいというだけなのです。

Morse code revolutionized communication, but in the next century, it would transform a totally different industry.モールス信号は通信に革命をもたらしましたが、次の世紀には全く異なる業界を変革することになります。

In the late 1940s, Bernard Silver was an engineering student at Drexel University in Pennsylvania.1940年代後半、バーナード・シルバーはペンシルベニア州のドレクセル大学の工学部学生でした。

One day, he overheard the president of a local supermarket chain asking the engineering dean to find a way to speed up the checkout process.ある日、彼は地元のスーパーマーケットチェーンの社長が工学部長にレジの処理を速くする方法を見つけてほしいと頼んでいるのを耳にしました。

At that time, cashiers had to type in each item and its price by hand, a process so tedious and repetitive that many cashiers had developed carpal tunnel syndrome.当時、レジ係は各商品とその価格を手で入力しなければならず、その作業は非常に退屈で反復的なため、多くのレジ係が手根管症候群を発症していました。

Silver told his friend Norman Joseph Woodland about the problem, and together they began experimenting.シルバーは友人のノーマン・ジョセフ・ウッドランドにその問題について話し、二人で実験を始めました。

After several false starts, Woodland moved down to Florida, and one day, on the beach, he drew some dots and dashes of Morse code in the sand,何度かの失敗を経て、ウッドランドはフロリダに移り住み、ある日、浜辺で砂の上にモールス信号の点とダッシュを描きました、

something he was very familiar with as a Boy Scout.ボーイスカウトとしてよく親しんでいたものでした。

He recalls, I just extended the dots and dashes downwards and made narrow lines and wide lines out of them,彼は振り返ります、「点とダッシュをただ下向きに伸ばして、細い線と太い線にしたんだ」と、

and thus the first barcode was created.こうして最初のバーコードが生まれました。

From this humble beginning evolved the Universal Product Code or UPC barcode, capable of storing a simple string of twelve numbers.このささやかな始まりから、12個の数字の単純な並びを格納できるUPCバーコード、すなわち万国製品コードが生まれました。

It's read by scanning a laser across it and checking how much light is reflected to read the black and white lines, essentially as dots and dashes.レーザーを当てて走査し、反射する光の量を調べて白黒の線を読み取りますが、本質的には点とダッシュとして読み取るのです。

A pair of vertical lines are placed at the beginning, middle, and end to ensure the scanner reads the code properly.スキャナーがコードを正しく読み取れるよう、最初と真ん中と最後に一対の垂直線が配置されています。

The code is divided into left and right halves.コードは左右の半分に分けられています。

Numbers at either side have their black and white lines flipped so that the scanner can tell left and right apart even while reading upside down.左右の数字は白黒の線が反転されており、逆さまに読んでもスキャナーが左右を区別できるようになっています。

When viewed upright, the numbers typically specify the manufacturer on the left and the product on the right.正しい向きで見ると、通常、左側が製造業者、右側が製品を示しています。

Manufacturers actually pay large sums of money to reserve a given amount of numbers to themselves so that they can exclusively register their products.実際、メーカーは自社製品を独占的に登録できるよう、一定量の番号を確保するために多額のお金を支払っています。

In this way, the 12 digits of a barcode uniquely specify every single grocery item you've ever bought.このように、バーコードの12桁の数字は、あなたが今まで買ったすべての食料品を一意に特定しているのです。

This jar of Jif peanut butter is identified by the same 12 digits, no matter where in the world it's found.このJifのピーナッツバターの瓶は、世界のどこにあっても同じ12桁の数字で識別されます。

And all forms of peanut butter, smooth, crunchy, stir, no stir, sugar-free, low sodium, across all brands, get their own unique barcode.そしてすべてのブランドのあらゆる種類のピーナッツバター、滑らか、粒入り、かき混ぜ式、かき混ぜ不要、無糖、低ナトリウムなどが、それぞれ独自のバーコードを持っています。

Will we ever run out of barcodes?バーコードがなくなることはあるのでしょうか?

Well, twelve digits could combine to provide ten to the twelve.12桁の数字の組み合わせで10の12乗が得られます。

That is a trillion different possible sequences.つまり1兆通りの異なる組み合わせが可能です。

That should be more than enough, even if companies keep making stuff like Sour Patch Oreos and flaming hot Mountain Dew.サワーパッチ・オレオや激辛マウンテンデューのような製品を作り続けても、それで十分すぎるほどでしょう。

But there is a catch.しかし、落とし穴があります。

The last digit is not independent of the others.最後の1桁は他の桁から独立していないのです。

The barcode creators were aware that it could get scratched, stained, or tampered with, so they reserved the last digit to verify that the barcode is complete.バーコードの開発者たちは、傷や汚れ、改ざんされる可能性があることを認識していたため、バーコードが完全であることを確認するために最後の桁を確保しました。

Take any barcode and sum the digits at odd numbered positions.任意のバーコードを取り、奇数番目の位置にある数字を合計します。

Multiply this result by three.この結果に3を掛けます。

Add the digit sum at even numbered positions to the result, and take the remainder when this number is divided by ten.偶数番目の位置の数字の合計をその結果に加え、この数を10で割った余りを取ります。

If this remainder is zero, then the check digit is zero.この余りがゼロなら、チェックディジットはゼロです。

Otherwise, the check digit is ten minus this remainder.そうでなければ、チェックディジットは10からこの余りを引いたものになります。

If a scanner is unable to read any one digit of the barcode, it can use the final digit to back calculate what it must be using this algorithm.スキャナーがバーコードのいずれか1桁を読み取れない場合、このアルゴリズムを使って最後の桁から本来の数字を逆算できます。

But if two digits are damaged, well then we're out of luck.しかし2桁が損傷してしまったら、もうお手上げです。

In that case, we have to type in the numbers printed below the barcode.その場合は、バーコードの下に印刷された数字を入力しなければなりません。

So without that last digit, the number of unique possibilities is ten to the eleven, or a hundred billion options.つまり最後の桁を除くと、一意な組み合わせの数は10の11乗、すなわち1000億通りになります。

To date, 1.24 billion barcodes have been registered, a number that is rising every day.これまでに12億4000万件のバーコードが登録されており、その数は毎日増え続けています。

So they won't last us forever.ですから永遠に使い続けられるわけではありません。

But that's not why people began to look for alternatives to barcodes.しかし人々がバーコードの代替手段を探し始めたのは、そのためではありません。

It was really the amount of information a single barcode could store.本当の理由は、1つのバーコードに格納できる情報量でした。

Twelve digits by themselves could only identify one product.12桁だけでは、1つの商品を識別することしかできませんでした。

But what if someone wanted to know more information, like where that product came from?でも、その商品がどこから来たのかなど、もっと多くの情報を知りたい場合はどうでしょうか?

In 1986, cattle in the UK began showing symptoms of a curious brain disease, bovine spongiform encephalopathy, or mad cow disease for short.1986年、イギリスの牛に奇妙な脳の病気、牛海綿状脳症、通称狂牛病の症状が現れ始めました。

It is spread when cattle eat feed containing prions, misfolded proteins,これは牛がプリオン、つまり異常に折りたたまれたタンパク質を含む飼料を食べることで広がり、

and if people eat beef containing tissue from the brain or spinal cord of infected cattle,そして人々が感染した牛の脳や脊髄の組織を含む牛肉を食べると、

they could contract a related brain illness that literally turns your brain into a sponge.文字通り脳がスポンジ状になる関連する脳疾患にかかる可能性があります。

Now, as no test could detect mad cow disease in living cows, millions of cattle were culled.生きた牛の狂牛病を検出できる検査がなかったため、何百万頭もの牛が処分されました。

Health officials sought a method to track sources and imports of beef,保健当局は牛肉の供給源や輸入を追跡する方法を模索しましたが、

but with all the information this would require for any one piece of beef, barcodes were insufficient.一切れの牛肉ごとに必要となるあらゆる情報を考えると、バーコードでは不十分でした。

American inventor David Allais tried to solve the problem by stacking many barcodes on top of each other.アメリカの発明家デイビッド・アレイは、多くのバーコードを重ねることでこの問題を解決しようとしました。

The result, Code 49, looked like a bookshelf.その結果生まれたコード49は、本棚のように見えました。

This is actually the predecessor of PDF 417, a code often used on airline boarding passes.これは実は、航空機の搭乗券などによく使われるPDF417の前身です。

But Code 49 didn't solve the data quantity problem.しかしコード49は、データ量の問題を解決しませんでした。

At best, it multiplied the information a barcode could carry by a handful.せいぜい、バーコードが運べる情報を数倍にしただけでした。

A more efficient way was to extend barcodes into two dimensions, creating a data matrix.より効率的な方法は、バーコードを二次元に拡張し、データマトリックスを作ることでした。

NASA tried this in 1994 with Vericode, used to track and identify space shuttle parts.NASAは1994年にベリコードでこれを試み、スペースシャトルの部品の追跡と識別に使いました。

This code was read by early digital cameras rather than lasers and was initially proprietary.このコードはレーザーではなく初期のデジタルカメラで読み取られ、当初は独自仕様でした。

Around the same time, Masahiroほぼ同じ頃、原正浩

Hara, an engineer at a Japanese auto parts manufacturer Denso, was getting frustrated at having to scan multiple barcodes for filling in the same box of car components.日本の自動車部品メーカー、デンソーの技術者である原は、同じ箱の自動車部品のために複数のバーコードをスキャンしなければならないことに苛立っていました。

Hara set out to develop an alternative on his own.原は自ら代替案の開発に乗り出しました。

He took inspiration from an unusual source.彼は意外なものからヒントを得ました。

To understand how information is stored in a QR code,QRコードに情報がどのように格納されるかを理解するために、

I am going to build one myself in the way Masahiro Hara first conceptualized it with a Go board.原正浩が最初に考案した方法で、碁盤を使って自分で一つ作ってみます。

I have the usual black and white stones.通常の白黒の石を用意しました。

White represents zero.白はゼロを表します。

Black represents one.黒は1を表します。

We're going to encode the link to our YouTube channel on this board.この盤上に私たちのYouTubeチャンネルへのリンクをエンコードします。

So the first step is to convert www.youtube.com/Veritasium into ones and zeros, and we'll do that using byte encoding.まず最初のステップは、www.youtube.com/Veritasiumを1と0に変換することで、バイトエンコーディングを使って行います。

Byte encoding uses ASCII, which itself has roots in Morse code.バイトエンコーディングはASCIIを使用し、ASCII自体はモールス信号にルーツがあります。

Every character is assigned a number from one to 256.各文字には1から256までの数字が割り当てられています。

Then we convert the ASCII decimal into its binary form.そしてASCIIの10進数を2進数に変換します。

Since 256 is 2 to the power of 8, we can use the eight binary bit combinations to represent all ASCII characters.256は2の8乗なので、8ビットの2進数の組み合わせで全てのASCII文字を表すことができます。

These eight bits make up one byte of information.この8ビットが1バイトの情報となります。

The letter W is assigned the ASCII decimal one one nine, or zero one one one zero one one one.文字WにはASCIIの10進数で119、つまり01110111が割り当てられています。

Doing the same for all characters in triple w dot youtube dot com slash veritasium, this is what the string looks like in binary.トリプルWドットユーチューブドットコムスラッシュベリタシウムの全文字に同じことをすると、この文字列は2進数ではこのようになります。

This is twenty six characters long, so it takes up twenty six bytes of information.これは26文字なので、26バイトの情報量になります。

Now our board is twenty five by twenty five.今、私たちのボードは25×25です。

This is known as a version two QR code, but there are many different sizes, all readable by your phone camera.これはバージョン2のQRコードとして知られていますが、さまざまなサイズがあり、すべてスマホのカメラで読み取れます。

Hara's version one QR code was twenty one by twenty one, and the largest version today is a hundred and seventy seven by a hundred and seventy seven.原さんのバージョン1のQRコードは21×21で、現在の最大バージョンは177×177です。

That is large enough to hold three kilobytes of information.それは3キロバイトの情報を格納できるほど大きいです。

Just twenty six of these would have been enough to store all the information Apollo eleven's computer needed to send humans to the moon.わずか26個で、アポロ11号のコンピューターが人類を月に送るのに必要だった全情報を保存できたでしょう。

One programmer even coded up a computer game, Snake, into a version 40 QR code.あるプログラマーは、コンピューターゲーム「スネーク」をバージョン40のQRコードに組み込んだことさえあります。

The region around a QR code must be empty and of uniform color.QRコードの周囲の領域は空で、均一な色でなければなりません。

This is the quiet zone.これがクワイエットゾーンです。

A distinguishing feature of QR codes is the three square patterns in the corners.QRコードの特徴は、角にある3つの四角いパターンです。

These position squares allow the reader to identify the orientation of the code.これらの位置検出パターンにより、読み取り装置はコードの向きを識別できます。

Now, almost all QR codes also have a fourth square in the last corner, but it's smaller and hence trickier to spot.現在、ほぼすべてのQRコードには最後の角にも4つ目の四角がありますが、より小さく、見つけにくくなっています。

This is the alignment pattern.これがアライメントパターンです。

It's used to rescale the QR code when it's read from varying distances or from crazy oblique angles.これは、さまざまな距離や極端な斜めの角度から読み取る際にQRコードを再調整するために使われます。

The relative size and distance of the alignment square with respect to the position squares allows the software to rescale it into a proper square.位置検出パターンに対するアライメントの四角の相対的な大きさと距離により、ソフトウェアはそれを正しい正方形に再調整できます。

Next to the position squares are plain white strips that isolate them from the rest of the code.位置検出パターンの隣には、それらをコードの他の部分から分離する白い帯があります。

And these are timing strips, zebra pedestrian crossings, which connect the top left position square with the other two.そしてこれらはタイミングパターン、ゼブラの横断歩道のようなもので、左上の位置検出パターンを他の2つとつないでいます。

Every QR code has these alternating strips.すべてのQRコードにはこの交互の帯があります。

You should look out for them.探してみてください。

QR codes of all sizes visibly look the same, so this tells your phone which version it is and therefore how much data to expect.どのサイズのQRコードも見た目は同じなので、これがスマホにバージョンを知らせ、どれだけのデータを期待すべきかを伝えます。

If there are five alternating squares, it's version one.交互のマスが5つあれば、バージョン1です。

If there are nine, it's version two, and so on.9つあればバージョン2で、以下同様です。

And next to those are format strips that contain rules for how to scan the code.そしてその隣には、コードのスキャン方法のルールを含むフォーマット情報があります。

I'm placing redstones in the space they occupy for now.今はそれらが占めるスペースにレッドストーンを置いています。

There is another feature every QR code has.すべてのQRコードに共通するもう一つの特徴があります。

This one pixel adjacent to the bottom right position square, it is always dark.右下の位置検出パターンに隣接するこの1ピクセルは、常に黒です。

I asked Hara-san if it had any special significance, but he said no.原さんに何か特別な意味があるのか聞きましたが、ないとのことでした。

Yeah, yeah, 本当にあの黒か白かどっちか決めると、これたま黒にしたという意味ですね。ええ、ええ、本当にあの黒か白かどっちか決めると、これたま黒にしたという意味ですね。

All of this remaining space is for data storage.この残りのスペースはすべてデータ保存用です。

Data inside a QR code always starts at the bottom right corner.QRコード内のデータは常に右下隅から始まります。

Here, the first four squares carry four bits that specify the data format.ここでは、最初の4つのマスがデータ形式を指定する4ビットを担っています。

Triple zero one if it's just numbers, zero zero one zero if it's alphanumeric, so capital letters and numbers,数字だけなら0001、英数字、大文字と数字なら0010、

zero one zero zero if it's information stored in bytes, and one zero zero zero for Japanese kanji.バイトで格納された情報なら0100、日本語の漢字なら1000です。

The following eight bits are used to indicate the number of characters in our message.次の8ビットはメッセージの文字数を示すために使われます。

So since we have twenty six characters, that should be zero zero zero one one zero one zero.26文字あるので、00011010になるはずです。

Next, we start arranging our bytes for youtube.com/veritasium, starting in eight bit two column cells.次に、youtube.com/veritasiumのバイトを、8ビット2列のセルから並べ始めます。

They follow a zigzag pattern that snakes its way to the top left.それらは左上へ蛇行していくジグザグパターンに従います。

Within each cell that represents a byte, the most significant bit, corresponding to two to the seven, is at the bottom right,バイトを表す各セル内では、2の7乗に対応する最上位ビットが右下にあり、

and the least significant, or two to the zero, is at the opposite end.最下位ビット、つまり2の0乗は反対側の端にあります。

Zero one one one zero one one one for W will hence be filled like this, and we'll follow along with the rest.Wの01110111はこのように埋められ、残りも同様に続けます。

Once we fill in the bytes for triple W dot U, we encounter the alignment pattern after four bits.WWW.Uのバイトを埋めると、4ビット後に位置合わせパターンに遭遇します。

To put in the next T, we simply bypass it and do the same for any of the other fixed regions of the code.次のTを入れるには、それを迂回し、コードの他の固定領域も同様にします。

Thus, we keep filling in our data in the same zigzag pattern.こうして、同じジグザグパターンでデータを埋め続けます。

After we complete triple W dot YouTube dot C, the cells start looking less regular and more Tetris-like,WWW.YouTube.Cを完成させると、セルは規則的でなくなり、テトリスのように見え始めますが、

but the way we put the stones, byte after byte, remains the same.石の置き方、バイトごとの並べ方は同じままです。

And there go the last eight bits for the last letter M.そして最後の文字Mの最後の8ビットが入ります。

But wait a minute, we've only covered about half of our QR code.でもちょっと待ってください、QRコードの半分ほどしか埋めていません。

Well, that's because this whole remaining space is reserved for redundancy.それは、この残りのスペース全体が冗長性のために確保されているからです。

These extra bytes of error correction code allow us to reconstruct information if the QR code is damaged.これらの誤り訂正コードの余分なバイトにより、QRコードが損傷しても情報を復元できます。

For a fully intact QR code, error correction makes something else possible:完全に無傷のQRコードの場合、誤り訂正によって別のことが可能になります:

putting a company logo at the center, just like the sponsor of this video, Saily.動画のスポンサーであるSailyのように、中央に会社のロゴを入れること、

Now I travel a lot.私は今、よく旅行をします。

Recently I was in Germany.最近ドイツにいました。

Right now I'm in Australia, and soon I'm going to the UK.今はオーストラリアにいて、まもなくイギリスに行きます。

But wherever you are, you need to have a working phone.でもどこにいても、使える電話が必要です。

Either you pay your home carrier's hefty roaming fees, or you have to find a place to buy a local SIM card, put it in the phone, and hope it works.自国のキャリアの高額なローミング料金を払うか、現地のSIMカードを買える場所を探して、携帯に入れて、動作を祈るしかありません。

This video sponsor, Saily, makes it easy to set up a cell plan and data.この動画のスポンサーであるSailyなら、携帯プランとデータの設定が簡単です。

in more than 150 countries.150か国以上で。

You can pick how much data you want and how long you want it for, and it is so much cheaper than roaming.データ量や利用期間を選べて、ローミングよりずっと安いです。

I'm actually going to the UK really soon, and here's how quickly I can set up an eSIM with Saily.実はもうすぐイギリスに行くのですが、SailyでeSIMを設定するのがどれだけ速いかお見せします。

All I have to do is click on the country, select a plan, and activate the eSIM.国をクリックして、プランを選んで、eSIMを有効化するだけです。

Then when I land, I'll automatically connect to a local network with no hidden charges.着陸すれば、隠れた料金なしで自動的に現地のネットワークに接続されます。

That's it.それだけです。

There's no need to hunt for public Wi-Fi, and you don't have to stand in line at the airport to get a physical SIM.公共Wi-Fiを探す必要も、空港で物理SIMのために並ぶ必要もありません。

With Saily, you set it up once, and you'll always be connected.Sailyなら一度設定すれば、常につながります。

And if you find out that your phone isn't compatible with eSIMs, you will get a full refund.万が一お使いの携帯がeSIMに対応していなかった場合は、全額返金されます。

So to check out Saily for free, go to saily.com/veritasium or click the link in the description.ぜひSailyを無料でチェックしてみてください、saily.com/veritasiumにアクセスするか、概要欄のリンクをクリックしてください。

Use the code Veritasium to get an exclusive 15% off your first purchase.コード「Veritasium」を使えば、初回購入が限定15%オフになります。

That's saily.com/veritasium, or you can scan this handy QR code to get 15% off.saily.com/veritasiumです、またはこの便利なQRコードをスキャンして15%オフをゲットしてください。

So I want to thank Saily.Sailyに感謝したいと思います。

for sponsoring this part of the video, and now back to building our own QR code.このパートのスポンサーをしてくれて、さて自分たちのQRコード作りに戻りましょう。

QR codes offer four levels of error correction: low, which can still be read with seven percent of the code missing;QRコードには4段階の誤り訂正レベルがあります:低レベルはコードの7%が欠けても読み取れます;

medium, which can handle fourteen percent; quartile twenty-five percent; and high, up to thirty percent.中レベルは14%に対応;四分位は25%;高レベルは最大30%までです。

This means a QR code could still be read properly even with nearly a third of it missing.つまり、ほぼ3分の1が欠けてもQRコードは正しく読み取れるということです。

Higher levels require more space for error correction, so knowing how much of the code is error correction is vital.高いレベルほど誤り訂正により多くの領域が必要なので、コードのどれだけが誤り訂正かが分かることは重要です。

This information is protected in two ways.この情報は2つの方法で保護されています。

First, the level of error correction is indicated in the format strip, which is present identically in two places.まず、誤り訂正のレベルはフォーマットストリップに示されており、これは2か所に同一に存在しています。

The simplest way to avoid errors is to duplicate the information.エラーを避ける最も簡単な方法は、情報を複製することです。

Here we'll choose the M level by placing one blue and one yellow stone here at the top left.ここでは、左上のここに青と黄色の石を1つずつ置いて、Mレベルを選びます。

So what if this part gets damaged?では、この部分が損傷したらどうなるでしょうか?

We have a copy in the second format strip, starting at the bottom left.左下から始まる2つ目のフォーマットストリップにコピーがあります。

The format strip contains three more bits of important information that we'll get to later.フォーマットストリップには、あとで説明する重要な情報の3ビットがさらに含まれています。

So for now, I'm just going to put down three blue stones in both copies.ですので今は、両方のコピーに青い石を3つ置くだけにします。

But what about all the rest of the format strip?では、フォーマットストリップの残りの部分はどうでしょうか?

Well, this is the second layer of protection.これは保護の第2層です。

These other ten bits are all just designed to correct mistakes in the first five bits.この他の10ビットはすべて、最初の5ビットの間違いを訂正するために設計されています。

So how does this work?では、これはどのように機能するのでしょうか?

Let's say I only wanted to communicate two levels of error correction to you, low or high.たとえば、誤り訂正の2つのレベル、低と高だけを伝えたいとしましょう。

If one of the bits flips in transmission to 01 or 10, it's easy to know that an error has occurred, but no way to know which the original message was.伝送中にビットの1つが反転して01や10になった場合、エラーが発生したことは簡単に分かりますが、元のメッセージがどちらだったかは分かりません。

An easy way to fix this is to add another bit, so 000 for low, 111 for high.これを解決する簡単な方法は、もう1ビット追加して、低を000、高を111にすることです。

Now these are at opposite ends of a cube and hence they are further apart.これでこれらは立方体の対角の端に位置し、したがってさらに離れます。

If you then receive 011, it's more likely that the intended message was 111, so it's easy to correct.その後011を受信した場合、本来のメッセージは111であった可能性が高いので、訂正は簡単です。

In this scheme, the only allowed codewords are triple 0 and triple 1.この方式では、許されるコードワードはトリプル0とトリプル1だけです。

The rest act as disallowed buffers to indicate errors in transmission.残りは、伝送中のエラーを示すための許可されないバッファとして機能します。

The allowed codewords should be as far apart as possible.許されるコードワードは、できるだけ離れているべきです。

Here they are three vertices apart.ここでは、それらは3つの頂点分離れています。

This is known as the Hamming distance after Richard Hamming, who pioneered the field of error correction.これは、誤り訂正の分野を開拓したリチャード・ハミングにちなんでハミング距離として知られています。

For a Hamming distance of n, you can correct up to n minus one over two errors in a binary string, so one bit flip in the previous example.ハミング距離がnの場合、2値文字列中の(n-1)/2までのエラーを訂正できるので、前の例では1ビットの反転です。

So back to the five bits of our format string.では、私たちのフォーマット文字列の5ビットに戻りましょう。

If I only wanted to communicate all zeros or all ones, I could place them at opposite corners of a five-dimensional hypercube.すべてゼロかすべて1だけを伝えたいなら、5次元超立方体の対角の角に配置できます。

However, our string includes all two to the five or thirty-two combinations of ones and zeros as valid code words.しかし、私たちの文字列は、1と0の2の5乗、つまり32通りの組み合わせすべてを有効なコードワードとして含んでいます。

So to provide buffers like before, we can extend the five-bit string into a fifteen-bit string.以前と同様にバッファを設けるために、5ビット文字列を15ビット文字列に拡張できます。

Now the thirty-two valid code words are each separated by seven vertices or Hamming distance of seven, which means we can correct up to three bit flip errors.これで32個の有効なコードワードはそれぞれ7頂点、つまりハミング距離7だけ離れることになり、最大3ビットのビット反転エラーを訂正できるということです。

The easiest way to do this is using a lookup table.これを行う最も簡単な方法は、ルックアップテーブルを使うことです。

The table takes a slightly misread vertex and finds the closest valid vertex, likely the intended code word.テーブルはわずかに誤読された頂点を受け取り、意図されたコードワードである可能性が高い、最も近い有効な頂点を見つけます。

But for our main QR code data, we need a far more efficient scheme, one that doesn't require lookup tables or doubling or tripling our data size.しかし、私たちの主要なQRコードデータには、ルックアップテーブルもデータサイズの2倍化や3倍化も必要としない、はるかに効率的な方式が必要です。

Let's say I want to send you a message that is the four numbers one, negative two, three, and five.例えば、1、マイナス2、3、5という4つの数字のメッセージを送りたいとします。

If I just send these numbers, one of them could get corrupted in transmission, and you wouldn't know that an error had occurred or which digit was wrong.これらの数字をそのまま送ると、送信中に1つが破損する可能性があり、エラーが発生したことやどの数字が間違っているかが分かりません。

So before I send the message, we come up with a plan.そこでメッセージを送る前に、計画を立てます。

First, instead of sending you four numbers, I will send six.まず、4つの数字の代わりに6つの数字を送ります。

The first four are my actual message, and the last two, A and B, will help you check if there were any errors.最初の4つは実際のメッセージで、最後の2つ、AとBはエラーがあったかどうかを確認するのに役立ちます。

Now I want you to treat these six numbers as the coefficients of a degree five polynomial,次に、これら6つの数字を5次多項式の係数として扱ってください、

and I will pick the values of a and b so that this polynomial could also be written in the form of a degree three polynomial.そして私はaとbの値を、この多項式が3次多項式の形でも書けるように選びます。

Call it q of x, times x minus one, x minus two.それをq(x)掛ける(x-1)、(x-2)と呼びましょう。

Now we could set these last two terms to be x minus any number, but for simplicity, let's say we pick one and two.この最後の2項はxマイナス任意の数にできますが、簡単にするために1と2を選ぶとしましょう。

That way, when you receive my polynomial, you know that if you plug in x equals one or x equals two, you should get zero for both, because that's how I constructed the polynomial.そうすれば、私の多項式を受け取ったとき、x=1やx=2を代入すればどちらもゼロになるはずだと分かります、なぜならそのように多項式を構築したからです。

And if you don't get zero, you know there has been an error in transmission.そしてゼロにならなければ、送信中にエラーがあったことが分かります。

They are called syndromes, which is an apt term, since syndromes are defined as a group of signs that occur together and characterize a particular abnormality.これらはシンドロームと呼ばれ、適切な用語です、シンドロームは共に起こり特定の異常を特徴づける一群の兆候と定義されるからです。

If the message polynomial is not zero at any of the syndrome values, then there is an error in the code.メッセージ多項式がシンドローム値のいずれかでゼロにならなければ、コードにエラーがあることになります。

So how do I find the values of a and b in our example?では、この例でaとbの値をどうやって見つけるのでしょうか?

Well, I take the polynomial without a and b and divide it by x minus one x minus two.まあ、aとbを除いた多項式を、xマイナス1、xマイナス2で割ります。

I get a degree three polynomial, which is what I want, but there is also a remainder of 37x minus 30.次数3の多項式が得られ、これは求めていたものですが、37xマイナス30という余りもあります。

So I can move this to the left hand side.なので、これを左辺に移項できます。

For the polynomial to take the form I want, a must be negative 37 and b positive 30.多項式を求める形にするためには、aはマイナス37、bはプラス30でなければなりません。

So I send the message one negative two three five negative 37 and 30.そこで、メッセージとして1、マイナス2、3、5、マイナス37、30を送ります。

You can plug in x equals one and x equals two, and if you get zero for both, you know the message was sent correctly.xイコール1とxイコール2を代入して、両方ともゼロになれば、メッセージが正しく送られたことが分かります。

But what if there was an error in transmission?しかし、伝送中にエラーがあったらどうなるでしょうか?

Say at position four, the number has changed to a six.例えば、4番目の位置で、数字が6に変わってしまったとします。

Well now if you evaluate at x equals one and two, the polynomial is no longer zero.さて、xイコール1と2で評価すると、多項式はもはやゼロになりません。

To figure out where the error occurred, one at a time, you set each coefficient to be a variable,エラーがどこで起きたかを突き止めるために、一つずつ、各係数を変数に置き換えて、

then find the value of that variable setting the polynomial equal to zero at x equals one.xイコール1のときに多項式がゼロになるような、その変数の値を求めます。

You repeat this for x equals two, and what you find is that the two values are different.これをxイコール2についても繰り返すと、2つの値が異なることが分かります。

This indicates that the second coefficient was not the error.これは、2番目の係数がエラーの原因ではなかったことを示しています。

You find the same for all the other coefficients except when you reach the one where the error occurred.エラーが起きた箇所にたどり着くまで、他のすべての係数についても同じ結果になります。

Here, not only are the two values equal, they are also equal to the originally transmitted number, that is five.ここでは、2つの値が等しいだけでなく、元々送信された数字、すなわち5とも等しくなります。

So this method allows us both to check and correct errors with only a modest increase in data size.つまり、この方法を使えば、データサイズをわずかに増やすだけで、エラーの検出と訂正の両方ができるのです。

This is a toy example of a Reed-Solomon error-correcting code developed by mathematicians Irving S.これは、数学者のアーヴィング・S・リードと

Reed and Gustav Solomon in 1960.グスタフ・ソロモンが1960年に開発したリード・ソロモン誤り訂正符号の簡単な例です。

The job of decoding Reed-Solomon codes in a brute force way, as we described, can quickly get intensive.私たちが説明したような力ずくの方法でリード・ソロモン符号を復号する作業は、すぐに大変になります。

In fact, as the Voyager spacecraft floated into the outer solar system, NASA engineers knew their signal-to-noise ratio would get incredibly small.実際、ボイジャー探査機が太陽系外縁部へと漂っていく中で、NASAの技術者たちは信号対雑音比が極めて小さくなることを知っていました。

But the promise of Reed-Solomon codes was such that they put an experimental encoder in before launch, wagering that smarter encoding algorithms would follow in the next decade.しかし、リード・ソロモン符号への期待が大きかったため、より賢い復号アルゴリズムが今後10年で登場することに賭けて、打ち上げ前に実験的な符号化器を搭載したのです。

And that's exactly what happened.そして、まさにその通りになったのです。

To this day, we can make out Voyager's ever faintening whispers thanks to Reed-Solomon codes.今日でも、リード・ソロモン符号のおかげで、ますますかすかになっていくボイジャーのささやきを聞き取ることができます。

These codes also ensure that your old CDs or DVDs can still play your favorite songs and movies despite multiple scratches.これらの符号があるおかげで、傷がたくさんあっても、古いCDやDVDでお気に入りの曲や映画を再生できるのです。

And they are the reason why QR codes still work when damaged.そして、損傷してもQRコードが読み取れるのはこの符号のおかげです。

In a QR code, the entire data, starting from the data type, character length byte,QRコードでは、データ種別、文字数バイトから始まる全データが、

our message bytes, and final padding, are laid out in a line and converted back into ASCII decimals.メッセージバイト、そして最後のパディングまでが一列に並べられ、ASCIIの10進数に戻して変換されます。

Fitting a high degree polynomial using these can easily make the coefficients blow up.これらを使って高次の多項式を当てはめると、係数が簡単に爆発してしまいます。

Hence, Reed Solomon encoding uses finite field arithmetic, Galois fields, to obtain the error correcting terms.そのため、リード・ソロモン符号化では、誤り訂正項を得るために有限体演算、ガロア体を使います。

These converted back into binary are used to fill out the rest of the QR code.これらを再び2進数に戻したものが、QRコードの残りを埋めるのに使われます。

And there we have our complete QR code.そしてこれで完全なQRコードができました。

But why can't we scan it yet?でも、なぜまだスキャンできないのでしょうか?

See how these regions here appear uniformly white and black?ここの領域が一様に白と黒に見えるのが分かりますか?

Well, sometimes the encoded data can insert plain patterns and blank spaces just by chance.実は、符号化されたデータが偶然に単調な模様や空白を作り出してしまうことがあるのです。

These can confound the readers, which expect to see a noisy checkerboard.読み取り機はノイズのような市松模様を期待しているので、これらに混乱してしまいます。

They think maybe it's a big damage patch or maybe it's not a QR code at all.大きな損傷部分かもしれないし、そもそもQRコードではないのかもしれないと思ってしまうのです。

But there is a way to fix this.しかし、これを修正する方法があります。

Remember the three blue stones I put in for masking in the format string?フォーマット文字列の中でマスキング用に入れた3つの青い石を覚えていますか?

Well, they specify one of eight ways to reshuffle the appearance of our QR code pixels to make them seem truly jumbled.それらは、QRコードのピクセルの見た目を本当にバラバラに見せるための8通りの方法のうち1つを指定するのです。

This particular mask says flip the pixels so white becomes black and black becomes white for every third column of data.この特定のマスクは、データの3列ごとに白を黒に、黒を白になるようピクセルを反転させなさいと指示しています。

But this does not apply to the functional elements of the code.ただし、これはコードの機能パターンには適用されません。

They remain unchanged.それらは変わらずそのままです。

The QR code standard specifies the use of eight masking patterns.QRコードの規格では、8つのマスキングパターンの使用が定められています。

In principle, when combined with the correct masking bits, all eight forms of the code are readable,原理的には、正しいマスキングビットと組み合わせれば、8つの形すべてが読み取り可能です、

which is why some QR code generators will return different-looking codes for the same input string.そのため、同じ入力文字列でも見た目の異なるコードを返すQRコード生成器があるのです。

But which one works best?では、どれが最もうまく機能するのでしょうか?

Well, every continuous or bad patch adds points, and each mask gets assigned a score.連続した模様や悪いパッチがあるたびに点数が加算され、各マスクにスコアが付けられます。

The mask with the lowest score at the end wins.最終的に最もスコアの低いマスクが選ばれます。

It's easiest for any reader to scan.それがどの読み取り機にとっても最もスキャンしやすいのです。

For our handmade QR code, I'm going to use the simplest mask.手作りのQRコードには、最もシンプルなマスクを使います。

And now we have a working QR code.そして今、動作するQRコードができました。

Try it out.試してみてください。

The moment of truth.運命の瞬間です。

Ah, it worked.ああ、うまくいきました。

You know, going through this exercise made me realize again why I hate QR codes.この作業を通して、改めてなぜQRコードが嫌いなのか分かりました。

They are not meant for people.あれは人間のためのものではないんです。

I made all kinds of mistakes while I was trying to put down these black and white stones.この白黒の石を並べている間、いろんなミスをしました。

This was really hard to get this perfect.これを完璧に仕上げるのは本当に大変でした。

I guess it didn't have to be perfect, but it had to be close enough.完璧である必要はなかったと思いますが、十分に近くなければなりませんでした。

All right.さて。

Initially, QR codes had only industrial uses.当初、QRコードは産業用途にしか使われていませんでした。

I no evaluated, but the company's, ma,上司としてではやっぱりこれが社会に通用するかわからないということで、まだそこの時にはそのなんですかね上司としてはこれが成功のプロジェクトが成功したと思ってなかったので。私は評価しなかったのですが、会社の、まあ、上司としてはやはりこれが社会に通用するか分からないということで、その時まだ上司としてはこのプロジェクトが成功したとは思っていなかったので。

But it wasn't long before the value of their data storage capacity was realized.しかし、そのデータ保存容量の価値が認識されるまで、そう時間はかかりませんでした。

In 2002, mad cow disease resurfaced in the UK.2002年、イギリスで狂牛病が再発しました。

179 people died from eating contaminated beef, and people panicked.汚染された牛肉を食べて179人が死亡し、人々はパニックに陥りました。

They wanted to know exactly where their meat was coming from and how it was stored before it reached the supermarket.人々は、自分たちの肉がどこから来たのか、スーパーに届くまでどのように保管されていたのかを正確に知りたいと思いました。

This time, the QR code was available to help.この時、助けとなるQRコードがありました。

It was one of the first instances where the curious checkerboards started to appear in common use.それは、あの不思議な市松模様が一般的に使われ始めた最初の事例の一つでした。

But why are QR codes so successful?しかし、なぜQRコードはこれほど成功したのでしょうか?

There are plenty of other 2D matrix codes out there.他にも2次元マトリックスコードはたくさんあります。

Well, one reason is that Denso Wave decided not to exercise patent rights on QR codes.一つの理由は、デンソーウェーブがQRコードの特許権を行使しないことを決めたことです。

Denso Wave instead opted to monetize and sell QR code scanners.デンソーウェーブはその代わりに、QRコードスキャナーを販売して収益化することを選びました。

Of course, with the rise of smartphones, most people would soon carry a QR code scanner in their pocket.もちろん、スマートフォンの普及により、まもなくほとんどの人がポケットにQRコードスキャナーを持ち歩くようになりました。

But initially, QR code reading apps were third-party and rather niche.しかし当初、QRコード読み取りアプリはサードパーティ製で、かなりニッチなものでした。

But then, in 2017, Android and Apple built QR code readers right into their camera apps.しかしその後、2017年にAndroidとAppleはカメラアプリにQRコードリーダーを直接組み込みました。

So the use of these codes took off.こうしてこれらのコードの利用が急増しました。

The COVID-19 pandemic also gave QR codes a boost worldwide.新型コロナのパンデミックも、世界的にQRコードを後押ししました。

Suddenly, restaurants and vendors wanted a contactless way to hand out menus and product information.突然、レストランや販売業者はメニューや商品情報を非接触で提供する方法を求めました。

Contactless payment using QR codes took off in India and China.QRコードを使った非接触決済はインドと中国で急増しました。

Today, India sees over 12 billion QR code-enabled transactions per month.今日、インドでは月に120億件を超えるQRコード対応の取引が行われています。

QR codes also proved handy in storing vaccine records and personal health information in phone wallets.QRコードは、ワクチン接種記録や個人の健康情報をスマートフォンのウォレットに保存するのにも便利であることが証明されました。

But their enormous spread has also created problems.しかし、その爆発的な普及は問題も生み出しました。

A question about QR code safety.QRコードの安全性についての質問です。

In recent years, some scammers have used QR codes to try to defraud people who read them.近年、一部の詐欺師がQRコードを悪用して、読み取った人々を騙そうとしています。

Do you have concerns about these uses?こうした利用について懸念はありますか?

So as with anything on the internet, you have to pay extra attention to safety.インターネット上のあらゆるものと同様に、安全性には特に注意を払う必要があります。

Check where a scanned QR code is taking you before actually clicking on a link.スキャンしたQRコードがどこへ誘導するか、実際にリンクをクリックする前に確認してください。

So I want to know about the future of QR codes.そこでQRコードの未来について知りたいのです。

What is next for QR codes?QRコードの次なる展開は何でしょうか?

QR codeで基本的にテキスト文字しか使えないのをまあ画像とかそこらへんも扱えるようにまあ情報を多くしていきたいと思います。QR codeで基本的にテキスト文字しか使えないのをまあ画像とかそこらへんも扱えるようにまあ情報を多くしていきたいと思います。

Now, if the possibility of running out of UPC barcodes is remote for QR codes, it is impossible.さて、UPCバーコードが枯渇する可能性がわずかにあるとすれば、QRコードについてはそれは不可能です。

The number of unique version one QR codes using the lowest redundancy level is two to the one hundred and fifty-two.最も低い冗長性レベルを使用したバージョン1のQRコードの固有の数は、2の152乗です。

This is about ten times the total number of legal chessboard configurations,これは合法的なチェス盤の配置の総数の約10倍であり、

which is also why a random distribution of pixels filled into a QR code pattern generally cannot be interpreted as a message.そのため、QRコードのパターンにランダムにピクセルを埋めたものは、一般的にメッセージとして解釈できないのです。

You have scanned countless QR codes, and when you scan your next one, you'll have a better idea of how it works.あなたは数えきれないほどのQRコードをスキャンしてきましたが、次にスキャンするときには、その仕組みがよりよく分かるでしょう。

But have you ever thought about what QR itself stands for?しかし、QR自体が何の略か考えたことはありますか?

QR codeの最大の特徴は、まあ早く読み取りができるところで、まあ素早く反応するということで、quick responseという名前をつけました。QR codeの最大の特徴は、まあ早く読み取りができるところで、まあ素早く反応するということで、quick responseという名前をつけました。

What is your favorite application of the QR code?QRコードのお気に入りの活用法は何ですか?

Keyboard shortcuts

Play / Pause
Space
Previous sentence
←
Next sentence
→
Replay each sentence
R
Show translation
T
Learning
S
Mastered
K
Close
Esc
Theater mode
W
Fullscreen
F
Keyboard shortcuts
?

Get the app

Sign in with the same account and your words and progress stay in sync.