Computer science
Computer science is the study of computation, which means processing information by following steps or rules. It studies algorithms and the hardware (the physical parts of a computer) and software (the programs it runs) that carry them out. An algorithm is an exact set of steps for solving a problem, like a recipe that a machine can follow.[1]
Computer scientists ask which problems such steps can solve, how fast they can solve them, and how to build machines and programs that run them. The field combines mathematics, science, and engineering.[1]
What computer science studies
The field's central question is what can be automated, and how efficiently. A 1989 report, Computing as a Discipline, by Peter Denning and colleagues, defined it as "the systematic study of algorithmic processes that describe and transform information: their theory, analysis, design, efficiency, implementation, and application." The report named the basic question as "What can be (efficiently) automated?"[1]
An earlier view puts the computer itself at the center. In 1967, Allen Newell, Alan Perlis, and Herbert Simon wrote that computer science is "the study of the phenomena surrounding computers."[2]
Critics said the field studies algorithms, not machines. The authors replied that "computers" meant the hardware, its programs, and "all that goes with them."[2]
Three ways of working
Denning describes three ways of working, each from an older field:[3]
| Way of working | Comes from | What it involves |
|---|---|---|
| Theory | Mathematics | Building notations and structures, then working out the logical results of axioms (starting statements accepted as true) and laws |
| Experimentation (also called abstraction) | Science | Building models of systems and testing whether they predict new behavior correctly |
| Design | Engineering | Building computer systems that support real work |
Some work is mainly one kind. Computational complexity is mainly mathematics, experimental study of algorithms is mainly science, and software engineering is mainly engineering. Most work combines all three.[1]
Core ideas
Information as bits
Computers store all information as strings of 0s and 1s. Electronic devices can easily hold two states, such as high and low voltage, so the binary digit, or bit, became the basic unit for storing and sending data.[4]
Claude Shannon's 1948 paper "A Mathematical Theory of Communication" founded information theory. It called binary digits "bits", a word Shannon credited to J. W. Tukey.[5]
Algorithms
An algorithm is a finite, step-by-step procedure that turns an input into a required output.[6] A classic early example is Euclid's algorithm for finding the greatest common divisor of two integers (whole numbers), which is the largest whole number that divides both evenly.[6]
Searching a list shows why the choice of algorithm matters. Linear search checks the items one by one, and if the target is missing, it has to check every item.[7] Binary search works only on a sorted list, but it is much faster:[7]
- Look at the middle item of the part of the list still in play.
- If it is the target, stop.
- If the target is smaller, keep only the left half. If larger, keep only the right half.
- Repeat until the target is found or nothing is left.
Each step halves the part still in play, so a list of items needs only about steps.[7] For a million items, that is about 20 steps, while linear search may need a million.
Data structures
A data structure is a way of organizing data so that algorithms can add, remove, and find items efficiently. Binary search, for example, needs its data kept in sorted order. Data structures and the algorithms that use them are heavily used in compilers, operating systems, file systems, and search engines.[4]
Abstraction
Abstraction means hiding details that do not matter for the task at hand. Computer scientists view a computer as a stack of layers. Each layer is built from the one below it, so a programmer can work at one layer without thinking about the others.[8]
At the bottom, a transistor acts as an on-off switch, and its two states stand for 1 and 0. Transistors are wired into logic gates, gates into processors, and so on up to the programs people use.[8]
Main areas
The main curriculum guide for the field lists 17 knowledge areas. It is CS2023, written jointly by the Association for Computing Machinery (ACM), the IEEE Computer Society, and the Association for the Advancement of Artificial Intelligence.[9][10] Its drafts sort most areas into three competency (skill) areas: software, systems, and applications.[11]
| Group | Knowledge areas |
|---|---|
| Software | Software development fundamentals; algorithmic foundations; foundations of programming languages; software engineering |
| Systems | Systems fundamentals; architecture and organization; operating systems; parallel and distributed computing; networking and communication; security; data management |
| Applications | Graphics and interactive techniques; artificial intelligence; specialized platform development; human-computer interaction; security; data management |
| Not in one group | Mathematical and statistical foundations; society, ethics, and the profession |
Security and data management, which covers databases, appear in both the systems and the applications groups.[11]
CS2023 adds a unit on society, ethics, and professionalism to most other knowledge areas, because computing affects so much of daily life.[10]
The areas overlap with each other and with other fields. Some, such as computational science, also overlap with fields like bioinformatics and computational chemistry.[4]
CS2023 dropped computational science as a separate knowledge area because its content was already covered elsewhere.[10]
Theory of computation
Theoretical computer science asks what can be computed at all, and what can be computed with a reasonable amount of time and memory.[12]
Turing machines
In 1936, Alan Turing described an imaginary machine to define precisely what "computable" means.[12] A Turing machine has a tape divided into squares, each holding one symbol. A head scans one square at a time, and the machine is always in one of a finite number of states.[13]
A state is the machine's current condition. At each step, the current state and the scanned symbol fully decide what happens next. The machine writes a symbol, moves one square left or right, and switches to a next state.[13]
Formally, a Turing machine is a quadruple
where is a finite set of states, is a finite set of symbols, is the starting state, and is the transition function. Given the current state and scanned symbol, returns the symbol to write, the direction to move ( or ), and the next state.[13]
Turing also described a universal Turing machine, which can compute anything that any other Turing machine computes.[13] This is the idea behind a general-purpose computer that can run any program.
The Church-Turing thesis
Alonzo Church's lambda calculus and Turing machines turned out to be equivalent, so anything computable in one is computable in the other.[12] The Church-Turing thesis holds that these precise models capture the everyday idea of "computable in principle." The Stanford Encyclopedia of Philosophy describes this belief as accepted by mathematicians without exception.[12]
Unsolvable problems
Some well-defined problems cannot be solved by any algorithm. The halting problem asks whether a given Turing machine will eventually stop on a given input. Turing proved that no algorithm can answer this for every machine and input.[12]
Church and Turing independently proved that the Entscheidungsproblem has no solution. It is Hilbert's question of whether a mechanical method can decide every statement of first-order logic, a standard system of logic that uses variables for objects and makes statements about their properties and relations. Turing derived this result from the fact that no algorithm can solve the halting problem.[12]
A counting argument shows that unsolvable problems are the rule, not the exception. Turing machines are countable, meaning they can be listed one by one, while sets of natural numbers (0, 1, 2, 3, and so on) are uncountable, meaning there are too many to list. So almost all such sets cannot be decided by any machine.[12]
Measuring efficiency
Computer scientists measure an algorithm's cost by how its number of steps grows with the input size . They ignore constant factors and keep only the fastest-growing term.[7] Big O notation states this as an upper bound:[6]
Here is the cost of the algorithm on inputs of size , and is a simpler comparison function. The constant absorbs fixed factors, and says the bound needs to hold only for large inputs.[6]
Binary search runs in time.[7] Linear search runs in time, because in the worst case it checks all items.
The classes P and NP
Complexity theory sorts problems into classes by the resources needed to solve them. The class P holds problems that a computer can solve in polynomial time, meaning a number of steps bounded by a polynomial in the input size, such as or . Problems outside P are not considered practical to solve.[12]
The class NP holds problems whose yes-answers have short proofs that can be checked quickly.[12]
An example is subset sum: given a list of numbers and a target, is there a subset that adds up exactly to the target? A proposed subset is easy to check. But no known method finds one in less than exponential time, which grows roughly like 2 raised to a power of the input size.[12]
NP-complete problems
The Boolean satisfiability problem (SAT) asks whether the true-or-false variables of a logic formula can be set so that the whole formula comes out true.[12]
SAT was the first problem proved NP-complete, by Stephen Cook in 1971.[12]
A reduction turns each instance of one problem into an instance of another, so that a method for the second also solves the first. A problem is NP-complete if it is in NP and every problem in NP reduces to it in polynomial time.[12] A fast algorithm for SAT would therefore give a fast algorithm for every problem in NP.
Cook and Leonid Levin each stated the P versus NP problem independently in 1971. It asks whether every problem whose answer is easy to check is also easy to solve.[14]
How the classes relate
The known relations between the main classes are
where PSPACE holds problems solvable with a polynomial amount of memory, and EXPTIME holds problems solvable in time for some polynomial . None of the three inclusions has been proved strict. The only proved separation is , so at least one inclusion must be strict.[12]
History
| Year | Event |
|---|---|
| Mid-1830s | Charles Babbage starts work on the Analytical Engine[15] |
| 1843 | Ada Lovelace publishes her notes on the Analytical Engine[16] |
| 1936 | Alan Turing describes his machines and proves the halting problem unsolvable[12] |
| 1945 | John von Neumann writes the First Draft of a Report on the EDVAC (June 30)[17] |
| 1946 | ENIAC is announced to the public (February 14)[18] |
| 1947 | The Association for Computing Machinery is founded[19] |
| 1948 | Claude Shannon publishes "A Mathematical Theory of Communication"[5] |
| 1953 | Cambridge starts the first taught computing course in Britain[20] |
| 1962 | Purdue founds the first computer science department in the United States[21] |
| 1966 | Alan Perlis receives the first Turing Award[22] |
| 1971 | Cook and Levin state the P versus NP problem[14] |
| 1989 | Computing as a Discipline defines the field[1] |
| 2000 | The Clay Mathematics Institute offers $1 million for solving P versus NP[23] |
Before electronic computers
Charles Babbage began designing the Analytical Engine in the mid-1830s. In modern terms, it would have been a general-purpose computer, but it was never built.[15]
In 1843, Ada Lovelace published a translation of an article on the engine, with long notes of her own.[16] Her notes included a method for computing Bernoulli numbers on the engine. The Computer History Museum calls it the first published description of a stepwise sequence of operations for solving certain mathematical problems.[16]
Historian Thomas Misa argues that Babbage and Lovelace each made important contributions to this work.[24]
Logic and the first computers
Turing's 1936 description of his machine was a milestone in the theory of computation.[4]
ENIAC, built at the University of Pennsylvania and announced in February 1946, was the first general-purpose electronic computer. It was programmed by plugging cables and setting switches.[18]
In 1945, John von Neumann's First Draft of a Report on the EDVAC described a stored-program computer. Such a machine keeps both its instructions and its data in electronic memory.[17] Storing instructions in memory was key to later theory about how algorithms behave.[4]
Becoming a discipline
The ACM was founded in 1947 "to advance the science, development, construction, and application of the new machinery for computing, reasoning, and other handling of information."[19]
The field was called computer science from its start in the 1950s.[1] Universities soon began teaching it:
| Year | Institution | Event |
|---|---|---|
| 1953 | University of Cambridge | Starts the Diploma in Numerical Analysis and Automatic Computing in October, the first taught computing course in Britain[20] |
| 1962 | Purdue University | Sets up the first computer science department in the United States in October[21] |
Related fields
Computer science is one of several computing disciplines. The ACM and IEEE Computing Curricula 2020 report describes seven of them.[25]
| Discipline | Main focus |
|---|---|
| Computer engineering | Joins computing with electrical engineering, with a focus on how hardware and software work together |
| Computer science | Algorithms, computation, and the design of computing systems |
| Cybersecurity | Protecting computing systems; curriculum guidelines first appeared in 2017 |
| Information systems | Using computing to meet the needs of organizations such as businesses |
| Information technology | Making technology available to people and organizations, and keeping it running |
| Software engineering | Designing reliable, trustworthy, secure, and usable software systems |
| Data science | Getting knowledge from data |
Computer science also draws heavily on mathematics and electrical engineering. Mathematics supplied the ideas of binary representation and the stored program, and electrical engineering supplied circuit design.[4]
Degree programs commonly require discrete mathematics. This includes logic, combinatorics (the study of counting and arranging objects), and graph theory (the study of networks of points and connections). Many programs also require calculus, statistics, numerical analysis, and physics.[4]
Organizations and awards
The ACM and the IEEE Computer Society are the main professional societies for computing. Together with the Association for Information Systems, they have produced the curriculum guidelines for computing disciplines since 1991.[4]
The ACM gives the A.M. Turing Award, often called the "Nobel Prize in Computing". It carries a $1 million prize funded by Google and is named for Alan Turing.[26] Alan Perlis received the first award in 1966.[22]
Open questions
The best-known open problem in computer science is P versus NP. It is one of the seven Millennium Prize Problems of the Clay Mathematics Institute, and each carries a $1 million prize.[23] Nobody has proved that problems like SAT or subset sum lack fast algorithms, even though none has been found.[14]
The nature of the field is still debated, and the philosophy of computer science treats these questions. Newell, Perlis, and Simon defended computer science as a science against critics who said that computers are artificial and so obey no fixed laws.[2] Denning later argued that the field combines science, engineering, and mathematics.[1]
References
- Is computer science science?, Peter J. Denning, Communications of the ACM, 2005.
- What is Computer Science? (letter by A. Newell, A. J. Perlis, and H. A. Simon, Science, 1967), Carnegie Mellon University, 1967.
- Computer Science: The Discipline, Peter J. Denning, 1999.
- Computer science, Encyclopaedia Britannica.
- A Mathematical Theory of Communication, C. E. Shannon, Bell System Technical Journal, 1948.
- Overview of Algorithm Design and Analysis, Engineering LibreTexts.
- Linear Search, Binary Search, and Worst-Case Analysis (lecture notes), University of Toronto, 2024.
- 5.2 Computer Levels of Abstraction, OpenStax, Introduction to Computer Science.
- Knowledge Areas of CS2023, ACM/IEEE-CS/AAAI, 2023.
- Computer Science Curricula 2023, Version Gamma, ACM/IEEE-CS/AAAI Joint Task Force, 2023.
- Computer Science Curricula 2023, Version Beta, ACM/IEEE-CS/AAAI Joint Task Force, 2023.
- Computability and Complexity, Stanford Encyclopedia of Philosophy.
- Turing Machines, Stanford Encyclopedia of Philosophy.
- P vs NP, Clay Mathematics Institute.
- Ada Lovelace and the Analytical Engine, Bodleian Libraries, University of Oxford, 2018.
- Ada Lovelace, Computer History Museum.
- June 30, 1945: "First Draft of Report on EDVAC" Published, Computer History Museum.
- ENIAC, Penn Engineering, University of Pennsylvania.
- About ACM, Association for Computing Machinery.
- The Diploma course, University of Cambridge Computer Laboratory, 2007.
- History of the Department, Purdue University Department of Computer Science.
- Turing Awardees, U.S. National Science Foundation.
- The Millennium Prize Problems, Clay Mathematics Institute.
- Charles Babbage, Ada Lovelace, and the Bernoulli Numbers, Thomas J. Misa, arXiv, 2023.
- Computing Curricula 2020: Paradigms for Global Computing Education, ACM and IEEE Computer Society, 2020.
- A.M. Turing Award, Association for Computing Machinery.
