第1章コンピューターサイエンス入門
What Is Computer Science?コンピューターサイエンスとは何か
The term computer science was popularized by George E. Forsythe in 1961. A mathematician who founded Stanford University’s computer science department, Forsythe defined computer science as “the theory of programming, numerical analysis, data processing, and the design of computer systems.” He also argued that computer science was distinguished from other disciplines by the emphasis on algorithms, which are essential for effective computer programming.3
英語のヒント
「コンピューターサイエンス」という言葉を広めたのは、1961年のジョージ・E・フォーサイスである。スタンフォード大学のコンピューターサイエンス学科を創設した数学者であるフォーサイスは、この分野を「プログラミング、数値解析、データ処理、コンピューターシステム設計の理論」と定義した。さらに、効果的なコンピュータープログラミングに不可欠なアルゴリズムを重視する点で、コンピューターサイエンスは他の学問分野と区別されると論じた。3
Computer science is not only about the study of how computers work, but also everything surrounding computers, including the people who design computers, the people who write programs that run on computers, the people who test the programs to ensure correctness, and the people who are directly and indirectly affected by computers. In this way, computer science is as much about people and how they work with computers as it is about just computers.
英語のヒント
コンピューターサイエンスが研究するのは、コンピューターの動作だけではない。コンピューターを設計する人、そこで動くプログラムを書く人、正しく動くことを確かめるためにプログラムをテストする人、コンピューターから直接・間接に影響を受ける人など、その周囲にあるすべてを対象とする。この意味で、コンピューターサイエンスは、コンピューターそのものについての学問であるのと同じくらい、人間と、人間がコンピューターとどのように関わるかについての学問でもある。
Not everyone agrees with this definition. Some people argue that computer science is more about computers or software than the people it affects. However, even if we were to study just the “things” of computer science, the people are still there. When someone designs a computer system, they are thinking about what kinds of programs people might want to run. Typically, effort is made to design the computer system so it is more efficient at running certain kinds of programs. A computer optimized for calculating missile trajectories, for example, won’t be optimized for running social media apps.
英語のヒント
この定義に誰もが同意するわけではない。コンピューターサイエンスは、影響を受ける人々よりも、コンピューターやソフトウェアを主に扱う分野だと考える人もいる。しかし、研究対象をコンピューターサイエンスの「もの」だけに絞ったとしても、そこには人間がいる。コンピューターシステムを設計する人は、利用者がどのようなプログラムを動かしたいと思うかを考える。通常、特定の種類のプログラムをより効率よく実行できるよう、システムの設計が工夫される。例えば、ミサイルの軌道計算に最適化されたコンピューターは、ソーシャルメディアのアプリを動かすことに最適化されているわけではない。
Many computing innovations were initially developed for military research and communication purposes, including the predecessor to the Internet, the ARPANET (Figure 1.3).
英語のヒント
コンピューティングに関する多くの革新は、当初、軍事研究や通信を目的に開発された。インターネットの前身であるARPANETも、その一つである(図1.3)。
1 S. Golomb, “Richard E. Bellman 1920–1984,” n.d. https://www.nae.edu/189177/RICHARD-E-BELLMAN-19201984 2 Geeks for Geeks, “Dynamic Programming or DP,” 2024. https://www.geeksforgeeks.org/dynamic-programming/ 3 D. E. Knuth, “George Forsythe and the Development of Computer Science,” Communications of the ACM, vol. 15, no.8, pp. 722–723. 1972. https://dl.acm.org/doi/pdf/10.1145/361532.361538
1 S. Golomb「Richard E. Bellman 1920–1984」、発行年不明。https://www.nae.edu/189177/RICHARD-E-BELLMAN-192019842 Geeks for Geeks「Dynamic Programming or DP」、2024年。https://www.geeksforgeeks.org/dynamic-programming/3 D. E. Knuth「George Forsythe and the Development of Computer Science」『Communications of the ACM』第15巻第8号、722–723頁、1972年。https://dl.acm.org/doi/pdf/10.1145/361532.361538

credit: modification of "Arpanet 1974" by Yngvar/Wikipedia, Public Domain · Public Domain · Source出典
Figure 1.3 The ARPANET, circa 1974, was an early predecessor to the Internet. It allowed computers at Pentagon-funded research facilities to communicate over phone lines. (credit: modification of "Arpanet 1974" by Yngvar/Wikipedia, Public Domain)
英語のヒント
図1.3 1974年頃のARPANETは、インターネットの初期の前身である。国防総省が資金を提供した研究施設のコンピューター同士が、電話回線を通じて通信できるようにした。(出典:Yngvar/Wikipedia「Arpanet 1974」を改変、パブリックドメイン)
What Is a Computer?コンピューターとは何か
While computer science is about much more than just computers, it helps to know a bit more about computers because they are an important component of computer science. All computers are made of physical, real-world material that we refer to as hardware. Hardware—which has four components, including processor, memory, network, and storage—is the computer component that enables computations. The processor can be regarded as the computer’s “brain,” as it follows instructions from algorithms and processes data. The memory is a means of addressing information in a computer by storing it in consistent locations, while the network refers to the various technological devices that are connected and share information. The hardware and physical components of a computer that permanently house a computer’s data are called storage.
英語のヒント
コンピューターサイエンスはコンピューターそのものよりはるかに広い範囲を扱うが、コンピューターは重要な構成要素なので、もう少し詳しく知っておくと役に立つ。すべてのコンピューターは、現実世界に存在する物理的な材料でできており、私たちはそれをハードウェアと呼ぶ。ハードウェアは計算を可能にするコンピューターの構成要素であり、プロセッサー、メモリ、ネットワーク、ストレージという四つの構成要素を持つ。プロセッサーは、アルゴリズムの指示に従ってデータを処理するため、コンピューターの「頭脳」と見なせる。メモリは、情報を一定の場所に保存することで、コンピューター内の情報を指定できるようにする手段である。一方、ネットワークとは、接続され、情報を共有するさまざまな技術的装置を指す。コンピューターのデータを永続的に格納するハードウェアや物理的な構成要素を、ストレージと呼ぶ。
One way to understand computers is from a hardware perspective: computers leverage digital electronics and the physics of materials used to develop transistors. For example, many of today’s computers rely on the physical properties of a brittle, crystalline metalloid called silicon, which makes it suitable for representing information. The batteries that power many of today’s smartphones and mobile devices rely on lithium, a soft, silvery metal mostly harvested from minerals in Australia, Zimbabwe, and Brazil, as well as from continental brine deposits in Chile, Argentina, and Bolivia. Computer engineers combine these substances to build circuitry and information pathways at the microscopic scale to form the physical basis for modern computers.
英語のヒント
コンピューターを理解する一つの方法は、ハードウェアの観点から見ることである。コンピューターは、デジタル電子工学と、トランジスターを作る材料の物理学を活用している。例えば、現在のコンピューターの多くは、シリコンという、もろく結晶性を持つ半金属の物理的性質を利用している。その性質が、情報を表現する材料としての適性を与えている。今日のスマートフォンや携帯機器の多くに電力を供給する電池は、リチウムを利用する。リチウムは柔らかく銀白色の金属で、主にオーストラリア、ジンバブエ、ブラジルの鉱物や、チリ、アルゼンチン、ボリビアの大陸のかん水鉱床から採取される。コンピューター技術者はこれらの物質を組み合わせ、微視的な規模で回路と情報の通り道を作り、現代のコンピューターの物理的基盤を形づくる。
However, the physical basis of computers was not always silicon. The Electronic Numerical Integrator and Computer (ENIAC) was completed in 1945, making it one of the earliest digital computers. The ENIAC operated on different physical principles. Instead of silicon, the ENIAC used the technology of a vacuum tube, a physical device like a light bulb that was used as memory in early digital computers. When the “light” in the vacuum tube is off, the vacuum tube represents the number 0. When the “light” is on, the vacuum tube represents the number 1. When thousands of vacuum tubes are combined in a logical way, we suddenly have memory. The ENIAC is notable in computer history because it was the first general-purpose computer, meaning that it could run not just a single program but rather any program specified by a programmer. The ENIAC was often run and programmed by women programmers (Figure 1.4). Despite its age and differences in hardware properties, it shares a fundamental and surprising similarity with modern computers. Anything that can be computed on today’s computers can also be computed by the ENIAC given the right circumstances—just trillions of times more slowly.
英語のヒント
しかし、コンピューターの物理的基盤が常にシリコンだったわけではない。Electronic Numerical Integrator and Computer(ENIAC)は1945年に完成し、最初期のデジタルコンピューターの一つとなった。ENIACは別の物理原理で動作した。シリコンの代わりに使われたのは、初期のデジタルコンピューターで記憶装置として用いられた、電球に似た物理的装置である真空管の技術だった。真空管の「明かり」が消えているとき、その真空管は数の0を表す。「明かり」がついていれば、数の1を表す。何千もの真空管を論理的に組み合わせると、記憶装置ができあがる。ENIACがコンピューターの歴史で重要なのは、最初の汎用コンピューターだったことである。つまり、一つの特定のプログラムだけでなく、プログラマーが指定するどのようなプログラムでも実行できた。ENIACの運用やプログラミングは、女性プログラマーが担当することが多かった(図1.4)。ENIACは古く、ハードウェアの性質も現代のコンピューターとは異なるが、両者には根本的で驚くべき共通点がある。適切な条件がそろえば、現在のコンピューターで計算できることは、ENIACでも計算できる。ただし、速さは何兆倍も遅い。

credit: modification of "Women holding parts of the first four Army computers" by U.S. Army/Wikimedia Commons, Public Domain · Public Domain · Source出典
Figure 1.4 This image depicts women programmers holding boards used in computers such as the ENIAC, many of which were designed expressly for ballistics and ordinance guidance research. Today, these room-size computers can be reproduced at a literally microscopic scale—basically invisible to the human eye. (credit: modification of "Women holding parts of the first four Army computers" by U.S. Army/Wikimedia Commons, Public Domain)
英語のヒント
図1.4 ENIACなどのコンピューターで使われた基板を持つ女性プログラマー。こうしたコンピューターの多くは、弾道学や兵器の誘導の研究を目的に特別に設計された。部屋を占める大きさだったこれらのコンピューターは、今日では文字どおり顕微鏡的な、人の目にはほぼ見えない規模で再現できる。(出典:U.S. Army/Wikimedia Commons「Women holding parts of the first four Army computers」を改変、パブリックドメイン)
How is this possible? The algorithmic principles that determine how results are computed makes up software. Almost all computers, from the ENIAC to today’s computers, are considered Turing-complete (or Computationally Universal, as opposed to specialized computing devices such as scientific calculators) because they share the same fundamental model for computing results and every computer has the ability to run any algorithm. Alan Mathison Turing was an English mathematician who was highly influential in the development of theoretical computer science, which focuses on the mathematical processes behind software, and provided a formalization of the concepts of algorithm and computation with the Turing machine. A Turing-complete computer stores data in memory (either using vacuum tubes or silicon) and manipulates that data according to a computer program, which is an algorithm that can be run on a computer. These programs are represented using symbols and instructions written in a programming language consisting of symbols and instructions that can be interpreted by the computer. Programs are also stored in memory, which allows programmers to modify and improve programs by changing the instructions.
英語のヒント
どうしてそれが可能なのだろうか。結果をどのように計算するかを決めるアルゴリズム上の原理が、ソフトウェアを構成する。ENIACから現代のコンピューターまで、ほぼすべてのコンピューターは、チューリング完全、すなわち計算万能であると考えられている。関数電卓のような用途を限定した計算機器とは異なり、計算結果を得るための同じ基本モデルを共有し、どのコンピューターにも任意のアルゴリズムを実行する能力があるためである。アラン・マシスン・チューリングはイギリスの数学者で、ソフトウェアの背後にある数学的な過程を扱う理論コンピューターサイエンスの発展に大きな影響を与えた。また、チューリングマシンを用いて、アルゴリズムと計算という概念を形式化した。チューリング完全なコンピューターは、真空管またはシリコンを使ってデータをメモリに保存し、コンピュータープログラムに従って操作する。コンピュータープログラムとは、コンピューター上で実行できるアルゴリズムである。プログラムは、コンピューターが解釈できる記号と指示で構成されたプログラミング言語で記述され、その言語の記号と指示を使って表現される。プログラムそのものもメモリに保存されるため、プログラマーは指示を書き換えて、プログラムを変更・改善できる。
While both hardware and software are important to the practical operation of computers, computer science’s historical roots in mathematics also emphasize a third perspective. Whereas software focuses on the program details for solving problems with computers, theoretical computer science focuses on the mathematical processes behind software. The idea of Turing-completeness is a foundational concept in theoretical computer science, which considers how computers in general—not just the ENIAC or today’s computers, but even tomorrow’s computers that we haven’t yet invented—can solve problems. This theoretical perspective expands computer science knowledge by contributing ideas about (1) whether a problem can be computed by a Turing-complete computer at all, (2) how that problem might be computed using an algorithm, and (3) how quickly or efficiently a computer can run such an algorithm. The answers to these questions suggest the limits of what we can achieve with computers from a technical perspective: Using mathematical ideas, is it possible to use a computer to compute all problems? If the answer to a problem is yes, how much of a computing resource is needed to get the answer?
英語のヒント
ハードウェアもソフトウェアも、コンピューターを実際に動かすうえで重要である。その一方で、数学にあるコンピューターサイエンスの歴史的な根は、第三の観点も重視している。ソフトウェアがコンピューターで問題を解くためのプログラムの詳細に焦点を当てるのに対し、理論コンピューターサイエンスは、ソフトウェアの背後にある数学的な過程に焦点を当てる。チューリング完全性は、理論コンピューターサイエンスの基礎概念である。この分野では、ENIACや現在のコンピューターだけでなく、まだ発明されていない将来のコンピューターも含め、コンピューター一般がどのように問題を解けるのかを考える。この理論的な観点は、(1)そもそもある問題をチューリング完全なコンピューターで計算できるか、(2)アルゴリズムを使ってその問題をどのように計算できるか、(3)そのアルゴリズムをコンピューターがどれだけ速く、効率よく実行できるか、という考え方をもたらし、コンピューターサイエンスの知識を広げる。これらの問いへの答えは、技術的な観点から、コンピューターで達成できることの限界を示す。数学的な考え方を用いれば、コンピューターですべての問題を計算できるだろうか。ある問題について可能だという答えが得られた場合、その答えを出すためにはどれだけの計算資源が必要なのだろうか。
Clearly both humans and computers have their strengths and limitations. An example of a problem that humans can solve but computers struggle with is interpreting subtle emotions or making moral judgments in complex social situations. While computers can process data and recognize patterns, they cannot fully understand the nuances of human emotions or ethics, which often involve context, empathy, and experience. On the flip side, there are tasks that neither computers nor humans can perform, such as accurately predicting chaotic systems like long-term weather patterns. Despite advancements in artificial intelligence (AI), computer functions that perform tasks, such as visual perception and decision-making processes that usually are performed by human intelligence, these problems remain beyond our collective reach due to the inherent unpredictability and complexity of certain natural systems.
英語のヒント
人間にもコンピューターにも、得意なことと限界があるのは明らかである。人間には解けてもコンピューターが苦手とする問題の例は、微妙な感情の解釈や、複雑な社会状況における道徳的判断である。コンピューターはデータを処理し、パターンを認識できるが、人間の感情や倫理の微妙な違いを完全には理解できない。そこにはしばしば、文脈、共感、経験が関わるからである。逆に、長期的な気象パターンのようなカオス的なシステムを正確に予測するなど、人間にもコンピューターにもできない作業がある。視覚的な認知や意思決定など、通常は人間の知能が行う仕事をコンピューターに行わせる機能である人工知能(AI)が進歩しても、こうした問題は、ある種の自然システムに本来備わる予測不可能性や複雑さのために、私たちの総体としての能力を超えている。
Theoretical computer science is often emphasized in undergraduate computer science programs because academic computer science emerged from mathematics, often to the detriment of perspectives that center on the social and technical values embodied by applications of computer technology. These perspectives, however, are gradually changing. Just as the design of ARPANET shaped the design of the Internet, computer scientists are also learning that the physical aspects of computer hardware determine what can be efficiently computed. For example, many of today’s artificial intelligence technologies rely on highly specialized computer hardware that is fundamentally different at the physical level compared to the general-purpose programmable silicon that has been the traditional focus of computer science. Organizations that develop human-computer interaction (HCI), a subfield of computer science that emphasizes the social aspects of computation, now host annual conferences that bring together thousands of researchers in academia and professionals in the industry. Computer science education is another subfield that emphasizes the cognitive, social, and communal aspects of learning computer science. Although these human-centered subfields are not yet in every computer science department, their increasing representation reflects computer scientists’ growing desire to serve not only more engaged students, but also a more engaged public in making sense of the values of computer technologies.
英語のヒント
大学の学士課程では、理論コンピューターサイエンスが重視されることが多い。学問としてのコンピューターサイエンスが数学から生まれたためであり、その結果、コンピューター技術の応用に体現される社会的・技術的な価値を中心に据える視点が、しばしば軽視されてきた。しかし、こうした見方は徐々に変化している。ARPANETの設計がインターネットの設計を形づくったように、コンピューターサイエンティストは、ハードウェアの物理的側面が何を効率よく計算できるかを決めることも理解しつつある。例えば、現在の人工知能技術の多くは、従来この分野の中心だった、汎用でプログラム可能なシリコンとは物理的な水準で根本的に異なる、極めて特殊化したハードウェアに依存している。人間とコンピューターの相互作用(HCI)は、計算の社会的側面を重視するコンピューターサイエンスの一分野である。この分野の発展に取り組む組織は現在、学界の研究者と産業界の専門家を何千人も集める会議を毎年開催している。コンピューターサイエンス教育も、学習の認知的・社会的・共同体的な側面を重視する一分野である。こうした人間中心の分野は、まだすべてのコンピューターサイエンス学科に存在するわけではない。それでも、その存在感が増していることには、より主体的に関わる学生だけでなく、コンピューター技術の価値を理解しようと、より積極的に関わる一般の人々にも役立ちたいという研究者の意欲の高まりが表れている。