Lecture 1-Introduction - AAST
Transcript of Lecture 1-Introduction - AAST
Lecture 1-Introduction
1
What is Computer Science?
Misconceptions
Definitions
Computation
The Limits of Computation
Algorithms
Fields
Ethical and Social Issues
Course Overview
2
Common misconceptions about computer science
◦ Computer science is the study of computers Initial pioneering work in the field of CS was based on a branch of logic and
applied mathematics (1920 – 1940). CS as an independent field was realized in the late 1950s to early 1960s.
◦ Computer science is the study of how to write computer programs Computer programs are written by special languages that the computer can
understand. Programming languages are only used to express new ideas and build and test
new solutions based on these ideas. Programming languages, just like computers, are only tools.
◦ Computer science is the study of the uses and applications of computers and software Several introductory courses to computer science surveys the different
computer applications that can be useful in everyday life. In spite of their wide use, learning computer applications has nothing to do
with studying computer science. Computer Science is responsible for specifying, designing, building, and
testing software packages and applications as well as the computer systems on which they run.
3
A quote from a famous computer scientist: “Computer Science is no more about computers than astronomy is about telescopes” Edsger Dijkstra (1930 -- 2002)
If CS is not the study of computers, what is it?
To answer this question, let’s first ask what computers are, and what they can do -- then come back to the main question of “what is computer science?”
4
When computers first started being widely used in the 1950s the general public viewed them as “electronic brains” ◦ they were huge, expensive, mysterious
◦ found only in the largest corporate, government, or university labs
Why a “brain” instead of some other metaphor? ◦ the calculations performed by computers
were the sorts of things only highly trained people were able to do
◦ example: compute the trajectory of a rocket
5
Today computers are essential tools in modern society
Personal computers (desktops and laptops) ◦ write papers, manage personal finances, .... ◦ entertainment: games, video, audio, ....
Business computers ◦ day-to-day operations: payroll, billing, ... ◦ customer service: web sites, customer data, ...
Embedded computers ◦ microchips used as controllers in cars, phones, buildings, ....
Supercomputers ◦ large “number crunchers” used in scientific research and
other areas ◦ parallel processing: from a few dozen to a few thousand
CPU chips
6
One way to approach the question of “what is a computer?” is to look at some of the things we don’t expect a computer to be able to do
Problem 1: Choose a college or university to attend
Would you trust a computer to solve this problem for you? ◦ several factors are involved, many of
them hard to quantify. ◦ you don’t expect another person to
solve this problem for you, either. ◦ the issue here is not the computer, it’s
the nature of the problem. ◦ in order to “compute” the best choice
you would need to be given a precise weight to each factor.
7
Problem 2: Invite friends over to watch a DVD It would be nice if our cell phones were more like personal assistants ◦ pick up the phone, say “invite Erica and
Katie over to watch a DVD” ◦ your phone would negotiate with their
phones to pick a time that works ◦ this is the sort of thing humans can do
(“have your people call my people...”)
Unlike the previous problem, this is an example of something humans can do that machines (so far) cannot ◦ will a future computer be able to solve
this problem?
8
Problem 3: The perfect game of chess You might think it would be easy for a computer to win a game of chess The rules of the game are simple, and it’s straightforward to write a program that would have a computer examine all possible moves The problem: there are too many moves to consider
◦ there are an estimated 1043 possible games ◦ a supercomputer checking 1012 boards/sec
would need 1021 years to look at them all
So here we have a new type of limitation: a practical limit
◦ people are no better than machines at performing this task
◦ grand masters do not consider all possible moves
9
Problem 4: Non-computable functions A famous problem in computer science is known as “the halting problem”
The goal: write a program that determines if another program is stuck
◦ suppose you’re writing a paper and the pointer changes to the “busy” icon
◦ it is impossible to write a “halt checker” to see if the word processor has crashed
◦ a new type of limitation: a mathematical barrier ◦ another example where people are no better
than machines at solving the problem
10
An interesting theme showed up on the previous slides Some tasks that computers cannot perform are also
impossible for humans The difficulty is in the nature of the problem, not the
person or thing trying to solve it A problem might not be solvable by humans or computers
because ◦ some attributes are not quantifiable (quality of life at a university) ◦ it is impractical (chess) ◦ it is impossible (halt checker)
Problems that humans can solve but computers can’t are often described in terms of “intelligence” ◦ natural language processing, planning, design, ... ◦ an active area of CS research: artificial intelligence (AI)
11
A computation is a sequence of well-defined operations that lead from an initial starting point to a desired final outcome. ◦ note this definition does not include the word
“computer”
◦ a computation is a process that can be carried out by a person or a machine
◦ the same computation might be carried out using any one of a number of different technologies
12
As an example of a computation, suppose we want to know the average age of a group of students
◦ in this case “average” means “arithmetic mean”
◦ method: compute the sum of the ages, then divide by the number of students
For a small group one could use paper and pencil or a hand calculator
For larger groups (e.g. average age of entering freshman class) one would probably use a computer
13
Computer science is the study of computation ◦ investigating problems that can be solved
computationally
◦ programming languages used to describe computations
◦ machines that carry out computations
◦ theoretical limits of computation (what is or is not computable)
◦ computational solutions to problems in math, science, medicine, business, education, journalism, ...
Computers play a key role ◦ but (getting back to Dijkstra) computer science is not
“about computers”
14
The sequence of steps carried out during a computation are defined by an algorithm ◦ an algorithm can be thought of as a “prescription”
◦ “follow these steps and you will solve your problem”
An algorithm includes a complete description of ◦ the set of inputs, or starting conditions
a full specification of the problem to be solved
◦ the set of outputs descriptions of valid solutions to the problem
◦ a sequence of operations that will eventually produce the output steps must be simple and precise
15
Computer Science is the study of algorithms, including ◦ Their formal and mathematical properties
Studying the behavior of algorithms to determine if they are correct and efficient
◦ Their hardware realizations Designing and building computer systems that are able to
execute algorithms
◦ Their linguistic realizations Designing programming languages and translating
algorithms into these languages so that they can be executed by the hardware
◦ Their applications Identifying important problems and designing correct and
efficient software packages to solve these problems
16
Correctness: ◦ Find the correct solution
Efficiency: ◦ Find the correct solution in the least number of
steps
17
Problem: ◦ You have a set of 9 balls and you know that one ball
weighs more than the rest. How would you find it using a two pan balance?
Correctness: ◦ find the heaviest ball
Efficiency: ◦ Number of times the balance will be used
18
Problem ◦ You are in a big class hall full of students and you
want to count the number of students in the hall
Correctness ◦ Count every one in the hall
Efficiency ◦ The time required to finish counting
19
Solutions ① Count one by one
② Count by two (½ the number of additions required in step 1)
③ Count by four (¼ the number of additions in step 1)
Correctness ◦ All students will be counted
Efficiency: Assume there are N students in the hall and it takes K msec to count once ① Count one by one (NK msec)
② Count by two (½ NK msec)
③ Count by four (¼ NK msec)
20
Apply the following Algorithm ① Give yourself the number 1
② Pair with someone beside you
③ Add your number to your partner
④ One of you holds on to the new sum and the other sits down
Correctness ◦ All students will be counted
Efficiency ◦ Log N
21
Computer Science is the study of algorithms, including ◦ Their formal and mathematical properties
Studying the behavior of algorithms to determine if they are correct and efficient
◦ Their hardware realizations Designing and building computer systems that are able to
execute algorithms
◦ Their linguistic realizations Designing programming languages and translating
algorithms into these languages so that they can be executed by the hardware
◦ Their applications Identifying important problems and designing correct and
efficient software packages to solve these problems
✔
22
Devising machines that can automate the task performed by an algorithm ◦ In CS the machine executing the algorithm is called a
computing agent ◦ In CS algorithms are based on computations
Arithmetic operations Relational operations Logical operations
◦ In CS algorithms written as instructions that could be understood by the underlying machine are called programs.
Computing Agent ◦ Fixed program computers ◦ Stored program computers
23
◦ Von Neumann Architecture Memory
Data
Program
CPU
Control unit Program Counter (PC/IP)
Arithmetic unit
Stored Program Computer
Jacquard automated loom machines
First programmable device
Mechanical machine
Patterns were input using punched cards
24
Computer Science is the study of algorithms, including ◦ Their formal and mathematical properties
Studying the behavior of algorithms to determine if they are correct and efficient
◦ Their hardware realizations Designing and building computer systems that are able to
execute algorithms
◦ Their linguistic realizations Designing programming languages and translating
algorithms into these languages so that they can be executed by the hardware
◦ Their applications Identifying important problems and designing correct and
efficient software packages to solve these problems
✔
✔
25
To be executed by the computing agent, algorithms need to be written into a language understandable by the underlying machine ◦ Algorithms Programs
In CS the computing agent is a computer ◦ Made of electric circuits ◦ Electric circuits has two states only (on = 1, off = 0)
Writing programs using 0’s and 1’s only is difficult and error prone
To ease the job, “higher level languages” were developed ◦ C, Java, C#, Python, etc …
Programs written in “higher level languages” are translated to machine code (0’s and 1’s) ◦ Compilers ◦ Interpreters
26
Computer Science is the study of algorithms, including ◦ Their formal and mathematical properties
Studying the behavior of algorithms to determine if they are correct and efficient
◦ Their hardware realizations Designing and building computer systems that are able to
execute algorithms
◦ Their linguistic realizations Designing programming languages and translating
algorithms into these languages so that they can be executed by the hardware
◦ Their applications Identifying important problems and designing correct and
efficient software packages to solve these problems
✔
✔
✔
27
Mathematical Calculations ◦ Mathematical Tool boxes
Euler Tool box,
Searching and Sorting ◦ Searching engines
Google, Bing, etc…
Text Manipulation ◦ Office Suite
Microsoft Word
2D-3D Drawings ◦ Graphical software
AutoCAD
28
29
Theory of computation is the branch that deals with how efficiently problems can be solved on a model of computation, using an algorithm. In order to perform a rigorous study of computation, computer scientists work with a mathematical abstraction of computers called a model of computation. There are several models in use, but the most commonly examined is the Turing machine.
Alan Turing in 1937 proposed that all computation could be performed by a special kind of a machine called a Turing machine. He based the model on the actions that people perform when involved in computation. He abstracted these actions into a model for a computational machine that has really changed the world.
30
We are living in the information age. We need to keep information
about every aspect of our lives. In other words, information is an asset
that has a value like any other asset. As an asset, information needs
to be secured from attacks. To be secured, information needs to be
hidden from unauthorized access (confidentiality), protected from
unauthorized change (integrity), and available to an authorized entity
when it is needed (availability).
The field covers all the processes and mechanisms by which
computer-based equipment, information and services are protected
from unintended or unauthorized access, change or destruction, and
is of growing importance in line with the increasing reliance on
computer systems of most societies worldwide
31
Data storage traditionally used individual, unrelated files, sometimes called flat-files. In the past, each application program in an organization used its own file. Today, however, all of these flat-files can be combined in a single entity, the database for the whole organization.
32
Software engineering is the study and application of engineering to the design, development, and maintenance of software.
33
Networking in the field of computing is the practice of linking two or more computing devices together for the purpose of sharing data. Networks are built with a mix of computer hardware and computer software.
Artificial intelligence (AI) is the intelligence of machines and the branch of computer science that aims to create it.
Artificial intelligence (AI) is the intelligence exhibited by machines or software. It is an academic field of study which generally studies the goal of emulating human-like intelligence.
The central problems (or goals) of AI research include reasoning, knowledge, planning, learning, natural language processing (communication), perception and the ability to move and manipulate objects.
34
Image Processing
Bioinformatics
Data mining
Computer Graphics
Etc.
35
36
Computers have created some arguments. We
introduce some of these arguments here. ◦ Dependency: Some people think that computers have created a
kind of dependency, which makes people’s lives more difficult.
◦ Social justice: Social justice is another issue we often hear about.
The advocates of this issue argue that using computers at home is a
luxury benefit that not all people can afford. The cost of a
computer, peripheral devices, and a monthly charge for Internet
access is an extra burden on low-income people.
◦ Digital divide: The concept of digital divide covers both the issues
of dependency and social justice discussed above. The concept
divides society into two groups: those who are electronically
connected to the rest of society and those who are not.
37
Computers have created some ethical issues. We
introduce some of these here.
◦ Privacy: Computers allow communication between two parties to be
done electronically. However, much needs to be done to make this type
of communication private. Society is paying a big price for private
electronic communication. Network security may create this type of
privacy, but it needs effort and costs a lot.
◦ Copyright: Another ethical issue in a computerized society is copyright:
who owns data? The Internet has created opportunities to share ideas, but
has also brought with it a further ethical issue: electronic copyright.
◦ Computer crime: Computers and information technology have created
new types of crime. Hackers have been able to access many computers in
the world and have stolen a lot of money. Virus creators design new
viruses to be sent through the Internet and damage the information stored
in computers.
38
39
40
Online Course Materials:
http://www.aast.edu/pheed/staffadminview/view_eng_content.php?ad
dcon=1&ser=31250&course_id=CS111&cyear=2014&term=1&type=1
41