# Foundations of Computer Science/Introduction

Have you ever wondered what computing is and how a computer works? What exactly is computer science? Why—beyond the obvious reasons—is it important? What do computer scientists do? What types of problems do they work on? What approaches do they use to solve those problems? How, in general, do computer scientists think?

**Question 1:** What do you think of when you hear "computer
science?" Write a paragraph or list, or draw an image or diagram of
what comes to mind.

**Question 2:** What are the parts of computer science that
are most interesting or important to you currently? Why?

When you hear the term "computer science" perhaps you think of a specific computer. Or someone you know who works with computers. Or a particular computer use, say online games or social networks. There are many, many different aspects of computing and computer science.

There are a number of reasons why it is useful and important to know something about this computer science. Computers affect many, many aspects of our lives in different ways. For many people, computers are playing or will play a significant role in the work they do, in their recreational pursuits, in how they communicate with others, in their education, in their health care, etc. Think about the many different ways you encounter computers and computing, either directly or indirectly, in your daily life.

What, more specifically, will this book cover? The foremost purpose of this text is to give you a greater understanding of the fundamentals of computer science: What is computer science, anyway? Is the same as computer programming? What is a computer? For example, most people would agree that a "laptop computer" is a computer, as is a "tablet computer", but what about a smartphone? And how do computers work? For example, we can store not only numbers and text in computers, but also images, video files, and audio files; how do computers handle such disparate data? And what are some interesting and important subareas of computer science? For example, what is important to know about subareas such as computer graphics, networking, or databases? And why is any of this important? Isn't it sufficient for most people just to use computers, rather than have a deeper understanding of computers and computer science?

These are all fundamental questions about computing, and in this book we'll look at them and other questions. In summary, one purpose of this book is to provide an overview of computer science that not only exposes you to computer science fundamentals—such as how a computer works on a rudimentary level—but also explores why these fundamentals are important.

There are two parts of this overview that are particularly important: while the main theme is an overview of computer science, two essential subthemes are how mathematics is used in computer science and how computer science affects, and is affected by, society.

Both subthemes fit well in an overview of computer science book. Computer science relies heavily on mathematics (in fact, some colleges have computer science and mathematics programs in a joint department). Certain uses of mathematics in computer science are obvious—for example, in computational tools such as spreadsheets—but there are also many less obvious ways that mathematics is essential to computer science. For example at the lowest level in a computer, data (whether that data is numeric, text, audio, video, etc.) is all represented in binary, i.e., as strings of 0's and 1's. This means that to understand something very basic about computers you need to understand binary numbers and operations.

Computers also affect society in many ways, from the use of computer-generated imagery in films, to large government or commercial databases, to the multiple societal effects of the Internet. And society affects computers, for example through user behavior and through different types of regulation.

While mathematics and technology and society might seem too different to be included comfortably in the same book, there are actually many computer science topics that are useful to explore from both perspectives—in a sense, these different viewpoints are "two sides of the same coin." For example, one topic in the book is computer security. Mathematics plays a role in security, for example in encryption. And computer security also has many societal aspects, for example national security, infrastructure security, and individual security. Most of the topics in this text similarly have both mathematical underpinnings and societal aspects, and exploring these topics from both perspectives will result in a richer understanding.

## Contents

## What this book isn't[edit]

There are a number of different types of introductory computer science books. So, in addition to explaining what this text is, it is also useful to state what it is not.

*This is not a programming book.* Programming is a central
activity in computer science, but it is not the whole of computer
science. Because programming is important, we'll spend some time on it.
However, because computer
science is much more than programming, and because this is an overview
book, that time will be only a small part of this work.

*This is not a computer applications book.* Many other books cover basic computer applications. For
example, a popular choice is teaching how to use a word processor,
a spreadsheet, a database management program, and presentation software.
These and other applications are important parts of computer
science, and so in this book you will get a chance to learn about
some applications that might be new to you. However—like programming—
using applications is only part of learning about computer science,
and so application use will be only a small part of this book.

*This is not a "computer literacy" or "computer fluency" book. There are a variety of definitions of computer literacy or*
computer fluency. For example, the Wikipedia definition,
derived from a report from the U.S. Congress of Technology Assessment,
is "the knowledge and ability to use computers and related technology efficiently, with a range of skills covering levels from
elementary use to programming and advanced problem
solving."^{[1]}
Parts of this book will involve using computers to gain a variety
of skills. For example, you will do
a variety of computer-related tasks such as performing web searches,
constructing web pages,
doing elementary computer programming, and working with databases.
However, this is just one part, rather than the totality, of the text.
So this book shares some characteristics of a computer literacy book,
but overall it has a wider focus than that type of a textbook.

*This is not a "great ideas in computer science" book.* One
current trend in computer science introductory materials is to study
computer science through its important, fundamental
ideas.^{[2]} And this book does cover some key ideas. For example,
an early topic we'll study is how all data in computers, whether those
data are numeric, text, video, or others, are represented within the
computer as 0's and 1's. In general, the topics in the book are
fundamental to computer science. However, this text also differs from
a great ideas book. It is not focused solely on ideas, but explores broadly
a number of computer-related issues, subtopics, and computer
skills. Moreover, this book focuses more on mathematical
thinking, and on technology and society, than a typical great ideas
book would.

In addition to programming, applications, computer fluency, and great ideas, there are a number of other types of introductory computer science textbooks. Some survey a variety of computer science topics. Others focus on professional software development practices. Still others look at look at computing through a particular "lens" such as networks or computational biology. And so on. This book has some common characteristics with these other courses, but also has significant differences. In particular, the biggest difference is this book blends an overview of computer science with a strong emphasis on mathematics, and on society and technology; this is a balance of emphases that has a number of advantages, but is not usually seen in introductory computer science courses.

## What is this book about?[edit]

Both mathematical thinking and technology and society are significant parts of this book. Many textbooks present an introduction to computer science though programming, or through how computers work, or through some other aspect of computing. However, there is not a suitable text that combines an overview of computer science with both sufficient mathematical and sufficient society and technology emphases.

At first glance, it might seem odd that a book introducing computer science would deal with liberal education. What does computer science have to do with liberal education? Understanding computers well involves exploring them from a variety of different viewpoints. This includes understanding not only how computers work—including, for example, the mathematical underpinnings of computer science—but also how they affect, and are affected by, society. In summary, to have a good understanding of computers and computer science it is important to explore them from a variety of perspectives, including the perspectives embodied in liberal education.

### Mathematical thinking[edit]

**Question 3.** What do you think of when you hear the word
"mathematics?" Write a paragraph or list, or draw an image or
diagram of what comes to mind.

**Question 4.** Based on your experience with computers, write a list
of some places where mathematics is used in computing.

What do computers and mathematics have in common? Why is it appropriate for an overview of computer science book to require mathematical thinking?

Much of the use of mathematics in this book is applying mathematical ideas and operations to solve computer science problems. There are a number of important mathematical underpinnings of computer science, and so understanding computer science involves being able to solve mathematical problems involving these underpinnings. At the same time, the different uses of mathematics in this text exemplify characteristics of mathematics as a whole, and of the close tie between the fields of mathematics and computer science. For instance, the mathematics in the book illustrates the following:

- The reliance of many key ideas in computer science, such as data representation, on mathematics.
- The use of special mathematics- or logic-related notation and terminology in many parts of computer science.
- The ability to represent and work with many different types of data in the computer, and the related ability to represent and work with quantities in different representations using a variety of operations.
- The need for rigor in solving problems, analyzing situations, or specifying computational processes.
- The use of numbers and arithmetic in solving computational problems. However, rather than being simple arithmetic problems, these problems often have some special characteristics such as involving repeated operations, or involving extremely large or extremely small numbers.
- The existence of a variety of different algorithms for solving such diverse problems as pattern matching, counting specified values in a table of data, or finding the shortest path between two nodes in a graph.

Solving many of the problems in this book will involve doing some mathematics, and therefore manipulating mathematical or logical symbols. Here are a few examples:

- In exploring low-level logical operations you'll need to manipulate binary representation and logical operators.
- In studying the growth rate of algorithms you'll need to work with the
*Ο*and*Θ*notations commonly used by computer scientists. - In specifying computational processes you'll need to use "pseudocode" or a programming language. These share many notational characteristics with mathematical or logical symbols, especially when the computational processing involves a large number of numeric computations.

The level of mathematics in this book is introductory-level college mathematics. As such, the mathematics is not advanced, and there is no mathematical prerequisite for this book beyond the requirements needed for general college admission. At the same time, the mathematics in this book goes beyond high school mathematics even though many of the types of mathematics used in this text appear in some high school mathematics courses.

As an example, one appearance of mathematics in this book is binary (or base 2) representation. This is a topic that often appears in high school mathematics courses, and the basics of binary representation are not complicated. In this book we review such basics as how to convert numbers between decimal (base 10) and binary representation, and how to do simple operations such as adding two binary numbers. However, we also use binary representation in additional ways that underpin the workings of computers. Here are a few examples:

- We'll look at a few different ways to represent numbers in binary representation. For example, integers are often represented in binary not using the usual straightforward binary representation, but in "two's complement" form. So part of this book is learning not only about the "usual" binary representation, but also about these alternatives.
- We'll look at various issues with binary representation, such as the number of "bits" used, that are important in determining the range and precision of numbers used by computers.
- In addition to representing numbers, we will also look at how computers use binary representation to represent and operate on other types of data such as text, colors, and images.
- In addition to basic operations such as binary addition, we will also look at other operations on binary representations. For example, logical operations are important in masking colors in image processing, and in implementing arithmetic operations in low-level computer hardware.

In summary, even though many of the mathematical topics in this book appear in high school mathematics, they go beyond the usual high school treatment of those topics in breadth or depth.

### Technology and society[edit]

**Question 5.** What do you think of when you hear "technology and society?"
Write a paragraph or list, or draw an image or diagram of
what comes to mind.

**Question 6.** Based on your experience with computing, write
a list of examples of how computing affects, and is affected by,
society.

The topic of this book is computers and computing. Computers have affected society in numerous and diverse ways, some of which we'll explore in this book. And current and future computer applications will affect society in even more ways.

Through this book you should get an understanding of how computers work. This includes understanding the basics of computer hardware and computer software.

More broadly, however, computer science relies on results from other areas of science, engineering, and related fields. The most prominent example of this we will see in this text is various ways that mathematics is essential in computer science.

Technology affects society. However, it is not a one-way street. Society also affects technology. For example, society fosters technology by means such as government support for research. As another example, different individuals, businesses, and other organizations adopt and use technology in ways often not foreseen by the technology's creators.

In this book we'll look at a variety of instances of how society affects technology. These include government funding for the early Internet, Internet regulation, how business considerations affect computing products, and societal aspects of computer security.

In many topics in computers and society there are multiple stakeholders. These can include individual users, developers, companies (producers, consumers, and intermediaries), government bodies, professional organizations, and other types of organizations. These different stakeholders often have different views and different goals.

In this book we will often look at technology and society issues from numerous perspectives. Sometimes we will focus on a specific perspective or the role of a specific stakeholder. However, other times we will explore issues more broadly: Who are the stakeholders? What is their role in this issue? What are their goals?

One often hears conflicting views on computer and society issues.
Computers are beneficial for society. Computers are harmful to
society. The Internet is making it easier for people to communicate
and is bringing people together. The Internet is making people
more isolated. Computers and automation are robbing people of
jobs. Computers and automation create jobs.^{[3]}

In this book we'll often explore issues that are contentious and/or complicated. How do we avoid a superficial, one-sided understanding of such issues? How do we resolve conflicting claims about such issues?

Computing technology not only has had massive effects on society, but continues to affect society. Not a day goes by without some technological advance involving computing. In many ways the "computer revolution" is just beginning.

One goal of this book is that you'll learn enough about computing in general, about trends in computing, and about computing and society that you'll be able to evaluate new technology. Note that "evaluate" might mean different things in different contexts. For instance, it might mean give an informed projection about whether a new computer product will be successful or not. Or it might mean predict future computer advances in a certain area. Or it might mean analyze whether a new computer application is more likely to be more beneficial than harmful.

## Additional questions for thought and discussion[edit]

Here are some additional introductory questions.

**Question 7.** How do you use computers? List the most important
ways.

**Question 8.** Write down a list of movies in which computing plays
a major role. For each movie, indicate whether computing is portrayed as
beneficial, harmful, beneficial in some ways but harmful in others, or
neutral.

**Question 9.** Do you think computers, on the whole, have
more positive effects than negative ones, more negative ones than positive,
or about equal positive and negative effects? Why?

**Question 10.** List some ways computers are beneficial
to society. Then list some ways they are harmful.

**Question 11.** Suppose you were to write a novel, play, screenplay,
etc. about some aspect of computers and society. Describe what the theme
or themes of your work would be.

**Question 12.** What does "technology" mean? What are some
important ways you use technology in your daily life?

**Question 13.** Suppose you had to write a short essay or short
story entitled "Computers and Me." What would be some key points
or themes in that work?

**Question 14.** Suppose you had to write a short essay or short
story entitled "Technology and Me." What would be some key points
or themes in that work?

## Notes[edit]

- ↑ See Computer literacy at the English Wikipedia. Accessed May 20, 2015.
- ↑ For example, see Denning, Peter. "Great Principles of Computer Science". http://denninginstitute.com/pjd/GP/GP-site/welcome.html. Retrieved May 20, 2015. This site organizes principles into seven categories: computation, communication, coordination, recollection, automation, evaluation, and design. There are a number of good ideas, insights, and frameworks in this and related approaches, and in fact many of the key ideas in this book will relate in some way to Denning's principles.
- ↑ See Putnam, Robert D. (August 2001).
*Bowling Alone: The Collapse and Revival of American Community*. Simon and Schuster. ISBN 978-0-7432-0304-3. http://books.google.com/books?id=rd2ibodep7UC. Retrieved 29 May 2015.