What Is Computer!
What Is Computer!
Science
Lecture 1
Topics covered in the lecture
What is Computer?
Benefits and Social Repercussions
Major Components of Computer
Hardware
• Input devices
• Processing Devices
• Storage
• Output devices
• Communication devices
Software
• System Software
• Application Software
Impact on
Reliability Storage Health Risks
Labor
Communication
Impact on
Environment
Major Components
• Hardware • Software
Types of Memory
ROM – (Read Only Memory) ROM is nonvolatile, meaning it holds
data even when the power is ON or OFF.
Types:
1. MROM (Mask ROM)
2. PROM (Programmable ROM)
3. EPROM (Erasable Programmable ROM)
4. EEPROM (Electrically Erasable Programmable ROM)
Types of RAM
RAM – (Random Access Memory) RAM is volatile, meaning it holds data
only when the power is on. When the power is off, RAM's
contents are lost.
1. Static RAM (SRAM)
2. Dynamic RAM (DRAM)
Secondary Storage
Currently, there are two common types of hard drive:
1. Hard Disk Drive (HDD)
2. Solid State Drive (SSD)
INTERFACES – the connecting part between the computer and the hard drive.
0-22
History of Algorithms
• The study of algorithms was originally a
subject in mathematics.
• Early examples of algorithms
– Euclidean Algorithm
0-23
The Euclidean algorithm
0-24
Computer Science
• The science of algorithms
• Draws from other subjects, including
– Mathematics
– Engineering
– Psychology
– Business Administration
0-25
Central Questions of Computer Science
• Which problems can be solved by algorithmic
processes?
• How can algorithm discovery be made easier?
• How can techniques of representing and
communicating algorithms be improved?
• How can characteristics of different algorithms
be analyzed and compared?
0-26
Central Questions of Computer Science
(continued)
• How can algorithms be used to manipulate
information?
• How can algorithms be applied to produce
intelligent behavior?
• How does the application of algorithms affect
society?
0-27
The central role of algorithms in computer
science
0-28
Definition of Algorithm
An algorithm is an ordered set of
unambiguous, executable steps that
define a terminating process.
5-29
Algorithm Representation
• Requires well-defined primitives
• A collection of primitives constitutes a
programming language.
5-30
Folding a bird from a square piece of paper
5-31
Origami primitives
5-32
Polya’s Problem Solving Steps
• 1. Understand the problem.
• 2. Devise a plan for solving the problem.
• 3. Carry out the plan.
• 4. Evaluate the solution for accuracy and its
potential as a tool for solving other problems.
5-33
Polya’s Steps in the Context of
Program Development
• 1. Understand the problem.
• 2. Get an idea of how an algorithmic function
might solve the problem.
• 3. Formulate the algorithm and represent it as
a program.
• 4. Evaluate the solution for accuracy and its
potential as a tool for solving other problems.
5-34
Getting a Foot in the Door
• Try working the problem backwards
• Solve an easier related problem
– Relax some of the problem constraints
– Solve pieces of the problem first (bottom up
methodology)
• Stepwise refinement: Divide the problem into smaller
problems (top-down methodology)
5-35
Ages of Children Problem
• Person A is charged with the task of determining the
ages of B’s three children.
– B tells A that the product of the children’s ages is 36.
– A replies that another clue is required.
– B tells A the sum of the children’s ages.
– A replies that another clue is needed.
– B tells A that the oldest child plays the piano.
– A tells B the ages of the three children.
• How old are the three children?
5-36
Figure 5.5
5-37
An algorithm must possess following characteristics :
1+2+3+….+100
Algorithm???
5,2,1,8,3
Algorithm???