SlideShare a Scribd company logo
1 of 43
Introduction to
Computer Science
Overview of Discussion
 What is computer science?
 What is a computer?
 What can computers do?
 How do computers solve problems?
 What is computer science?
 Who invented computers?
 Conceptual computers
 Computing devices
Learning Objectives
 Define and use terminology
 Examples: computer, computer science,
algorithm, specification, correctness, efficiency,
von Neumann machine
 Distinguish between algorithms and non-
algorithms
 Know something about the history of
computers (up to 1950)
Which one is the computer?
Rock Calculator Television
Modern Airplane Washing Machine Computer Workstation
Is it a Computer?
 What questions would
you ask?
 What experiments
would you run?
Is a rock a computer?
 Does not act or
process
 Takes no input and
produces no output
 Computers must be able to handle input and
output
Is a washing machine a computer?
 Input: dirty clothes
 Output: clean clothes
 Does not handle
information
 Computers input and output information
Is a television set a computer?
 Input: information from
cables or radio waves
 Output: information as
sound and picture
 Does not process
information
 Computers process information by computing
new results and answering queries
Is a modern airplane a computer?
 Input: information from
radio waves
 Output: manipulations
to the airplane
 Can only handle
specific information
necessary for flight
control
 Computers are general purpose because
they can perform many different tasks
Is an ordinary calculator a computer?
 Input: numbers and
mathematical operations
 Output: answer
 Handles any numeric task
 Cannot remember which
buttons are pressed
 Computers are programmable so they can
remember sequences of operations
Definition of a Computer
 a general purpose,
 programmable,
 information processor
 with input and output
Computing Agents
 Definition of computers does not cover all
that computer scientists study
 Broader class of objects and methods –
computing agents
 Have some or all of the characteristics of a
computer
Specialized Computing Devices and
Information Appliances
 Devices limited by set of operations or
programmability
 Calculators limited to operations described by
their buttons
 Global Positioning System (GPS) calculates
latitude and longitude from satellite signals
 Cell phone allows one to surf the web
 Information appliances – performs a single
job well
Embedded computers and robots
 Machines with full-fledged computers inside
 Washing machines, airplanes, ATMs, etc.
 Such machines require highly reliable,
predictable computer programs
 All physical mechanisms controlled by
computers are robotic devices
 Restrict definition to machines that are general
purpose and programmable
 Robotic arm or cart
Natural computing agents
 Living organisms process information in their
efforts to eat, survive, and reproduce
 1940s study showed frogs collect less visual
information than people
 Identify rapidly moving objects as food, slowly moving
objects as predators
 Study physical events in terms of information they
contain and process
 Chemical reactions, crystal formations, plant growth, etc.
What is a computer?
 Definition of a computer is narrow
 Definition of computing agent is broad
 Although many computer scientists focus on
the computer, some computer scientists deal
with computing agents
What can computers do – today?
 Business productivity managers
 Personal information managers
 Spreadsheets
 Database software
 Desktop publishing
 Multimedia encyclopedias
 Simulate the physical world
 Produce a music video
What might computers do – tomorrow?
 Diagnose diseases
 MYCIN captures medical knowledge in rules that
allowed a computer to identify an ailment based
on symptoms
 Control robots that walk, talk, and learn
 CMU created a program that drove a van from
Pittsburgh to D.C. using cameras for eyes
 Compose music and create art
How do computers solve problems?
 Humans deconstruct problems into small
operations that a computer can carry out
 Writing an algorithm
 Solve a problem by computer requires
 State the problem clearly in a problem statement
 Solve the problem with an algorithm that gives
clear instructions
 Use a computing agent to carry out the
instructions
Stating the problem clearly
 Describes what to do, not how to do it
 How do I get from Timonium Campus to the
Beltway?
 Solve general classes of problems
 How do I get from point A in Timonium to point B?
 What is the square root of y?
Specifying a problem
 Clear problem statement is called the
specification
 What information can we use as input
 What the output, or solution, to our problem
should look like
 Specification for the square root problem
 Input: A positive number y > 0
 Output: A positive number x such that x2 = y
 Make sure specification is not ambiguous
Solving the problem using an Algorithm
 Algorithm – a clear sequence of instructions
for performing a task
 a well-ordered sequence
 of well-defined,
 feasible operations
 that takes finite time to carry out
Finding the square root to the nearest
tenth
 For this example we are interested in the square
root of 55
1. Find the two integers between which √55 lies
 Do this by starting at 0 and continuing up through the
integers until you find an integer whose square is less than
55 and the next integer has a square larger than 55
2. Find the first estimate by averaging the two integers
3. Divided 55 by the estimate. Compute it to one more
place than you want in the final answer
4. Average the estimate and the result of step 3
5. Repeat steps 3 and 4 until the tenth digit does not
change
Almost Algorithms
 To shampoo your hair
1. Rinse
2. Lather
3. Repeat
 To set the time on the
VCR
1. Open the front panel
2. Push the button
3. Set the hours, then the
minutes
 To write the Great
American Novel
1. Get paper and pencil
2. Sit down
3. Write word on paper
4. If novel is great, quit.
Otherwise, go back to
step 3.
Using the computing agent
 The square root algorithm is only an
algorithm for an agent that understands
English and can perform arithmetic
 Requirements imposed by the computing
agent
 Algorithm is in a language the computing agent
understands
 Algorithm uses primitive operations that the agent
can carry out
Necessity of artificial languages
 Problems with natural languages (like
English)
 Flexible
 Often ambiguous
 Computers use artificial languages with
precise meanings
 mathematical equations, music notation,
programming languages
 Programming languages define primitive
operations computing agents understand
What is computer science?
 The study of computers
 The study of algorithmic processes including
their
 Theory
 Analysis
 Design
 Efficiency
 Implementation
 Application
Who invented computers?
 Computer science has roots in two fields
 Mathematics
 Alan Turing and the Turing machine (1930s)
 Developed theories with paper and pencil about how to
perform computations by hand
 Engineering
 John von Neumann and the von Neumann machine
(1940s)
 Showed how to build physical computers out of
electronic circuitry
Mathematical Roots
 Leibniz’s Dream (1600s)
 Can we find a universal language for
mathematical algorithms that will let us describe
and solve any problem?
 Reduce all reasoning to a fixed set of basic rules
 Determine truth or falsity of sentences by fixed rules for
manipulating sentences
 George Boole (1800s)
 Introduces binary notation of calculation
 Computers use binary system for logic and arithmetic
More on Theory
 David Hilbert (1928)
 Challenges the mathematical community to find
an infallible, mechanical method for constructing
and checking truth of mathematical statements
 Interested in an algorithm
 Alonzo Church, Alan Turing, and Kurt Gödel
construct arguments that there is no solution
to Hilbert’s Challenge
 Turing builds a conceptual computer for his
argument
The Turing Machine and the Church-
Turing Thesis
 Turing Machine
 Machine with a finite set of rules and an infinite
amount of “scratch paper” for computation
 No one has designed a physical computer that can do
more than a Turing machine
 Machine could not solve Hilbert’s problem
 Church-Turning Thesis
 The Turing Machine captures what we mean by
computational systems
 Is as powerful an any other mechanical computing
agent
Engineering Roots
 First step development of calculators
 Abacus – developed 5000 years ago in the Middle
East
 Pascaline – first mechanical calculator using
gears for calculation (1642)
 Charles Babbage’s Difference Engine –
conceptual design that used hundreds of gears to
compute mathematical functions (1820s)
Electronic Circuits
 Telegraph – uses electricity to convey letters
and transmit information quickly (1844)
 Hollerith Tabulating Machine – Uses
electricity and punch cards to calculate the
US census (1890)
 Z2 – used circuitry to compute arithmetic
operations (1930s)
Programmed Devices
 Jacquard Loom – weaves cloth using a pattern
specified using punch cards (1801)
 The Analytic Engine – conceptual design for a
machine consisting of a Mill, Store, Printer, and
Readers
 Led Ada Lovelace to define programming concepts such as
the subroutine
 ENIAC – one of the first programmable electronic
computers (1945)
 Programmed by routing cables and flipping switches
von Neumann Machine
 Store programs in electronic memory along
side the data (1943)
 Move and manipulate a program like data
 Enabled high-level programming languages
Input Central Processing
Unit (CPU)
Memory
Output
Machine Languages
 Only language computers directly understand
 “Natural language” of computer
 Defined by hardware design
 Machine-dependent
 Generally consist of strings of numbers
 Ultimately 0s and 1s
 Instruct computers to perform elementary operations
 One at a time
 Cumbersome for humans
 Example:
+1300042774
+1400593419
+1200274027
Assembly Languages
 English-like abbreviations representing elementary
computer operations
 Clearer to humans
 Incomprehensible to computers
 Translator programs (assemblers)
 Convert to machine language
 Example:
LOAD BASEPAY
ADD OVERPAY
STORE GROSSPAY
High-level Languages
 Similar to everyday English, use common mathematical
notations
 Single statements accomplish substantial tasks
 Assembly language requires many instructions to accomplish
simple tasks
 Translator programs (compilers)
 Convert to assembly language
 Interpreter programs
 Directly execute high-level language programs
 Example:
grossPay = basePay + overTimePay
Programming Approaches
 Structured programming (1960s)
 Disciplined approach to writing programs
 Clear, easy to test and debug, and easy to modify
 Focus on what the program does
 Object Oriented programming
 Object is an entity characterized by a state and a
behavior
 state is encoded in the computer program as data
 behavior is encoded as methods
Objects
 Reusable software components that model real
world items
 Meaningful software units
 Date objects, time objects, paycheck objects, invoice
objects, audio objects, video objects, file objects, record
objects, etc.
 Any noun can be represented as an object
 More understandable, better organized and easier
to maintain than structured programming
 Favor modularity
 Software reuse
 Libraries
C++
 C++ programs
 Built from pieces called classes and functions
 C++ standard library
 Rich collections of existing classes and functions
 “Building block approach” to creating
programs
 “Software reuse”
Basics of a Typical C++ Environment
 C++ systems
 Program-development environment
 Language
 C++ Standard Library
Basics of a Typical C++ Environment
Phases of C++ Programs:
1. Edit
2. Preprocess
3. Compile
4. Link
5. Load
6. Execute
Loader
Program is created in
the editor and stored
on disk.
Preprocessor program
processes the code.
Loader puts program
in memory.
CPU takes each
instruction and
executes it, possibly
storing new data
values as the program
executes.
Compiler
Compiler creates
object code and stores
it on disk.
Linker links the object
code with the libraries,
creates a.out and
stores it on disk
Editor
Preprocessor
Linker
CPU
.
.
.
.
.
.
.
.
.
.
.
.
Disk
Disk
Disk
Disk
Disk
Edit
Compile
Run
Make
Primary
Memory
Primary
Memory

More Related Content

Similar to Introduction to CS

Computer and its uses in modern life.pptx
Computer and its uses in modern life.pptxComputer and its uses in modern life.pptx
Computer and its uses in modern life.pptxMdNasirUddin592112
 
What is Computer | Computer Full Form | Computer Definition
What is Computer | Computer Full Form | Computer DefinitionWhat is Computer | Computer Full Form | Computer Definition
What is Computer | Computer Full Form | Computer Definitiondmir3304
 
CompFundamentals.ppt
CompFundamentals.pptCompFundamentals.ppt
CompFundamentals.pptChrisnaFucio
 
Evo And Gen Of Computers.pptx
Evo And Gen Of Computers.pptxEvo And Gen Of Computers.pptx
Evo And Gen Of Computers.pptxErmias Mesfin
 
UNit 1sbhejsjejdhdhdjjejejdhejjjdjdhdhheh.pptx
UNit 1sbhejsjejdhdhdjjejejdhejjjdjdhdhheh.pptxUNit 1sbhejsjejdhdhdjjejejdhejjjdjdhdhheh.pptx
UNit 1sbhejsjejdhdhdjjejejdhejjjdjdhdhheh.pptxhello1506hello
 
Lecture series 1 computer fundamentals
Lecture series 1 computer fundamentalsLecture series 1 computer fundamentals
Lecture series 1 computer fundamentalsEdgar Bryan Nicart
 
SRAS Computer 1
SRAS Computer 1SRAS Computer 1
SRAS Computer 1Rey Belen
 
Introduction to IT
Introduction to ITIntroduction to IT
Introduction to ITcpjcollege
 
Autocad and computer introduction for beginers
Autocad and computer introduction for beginers Autocad and computer introduction for beginers
Autocad and computer introduction for beginers Ayele Bedada
 
SSC-ICT 7_History of Computer_031810.pptx
SSC-ICT 7_History of Computer_031810.pptxSSC-ICT 7_History of Computer_031810.pptx
SSC-ICT 7_History of Computer_031810.pptxHaruHaru68
 
Introduction to computer science ch1
Introduction to computer science ch1Introduction to computer science ch1
Introduction to computer science ch1Mohamed Essam
 
Introduction to computer.pptx
Introduction to computer.pptxIntroduction to computer.pptx
Introduction to computer.pptxShahFahadKhan17
 
Computer fundamentals
Computer fundamentalsComputer fundamentals
Computer fundamentalsRajesh Dash
 
Basic Computer Computer notes
Basic Computer Computer notesBasic Computer Computer notes
Basic Computer Computer notesijazshah2005
 
Fundamentals of computers & information system
Fundamentals of computers & information system  Fundamentals of computers & information system
Fundamentals of computers & information system shefali mishra
 
Unit I Foc
Unit I FocUnit I Foc
Unit I FocJAYA
 

Similar to Introduction to CS (20)

Computer and its uses in modern life.pptx
Computer and its uses in modern life.pptxComputer and its uses in modern life.pptx
Computer and its uses in modern life.pptx
 
What is Computer | Computer Full Form | Computer Definition
What is Computer | Computer Full Form | Computer DefinitionWhat is Computer | Computer Full Form | Computer Definition
What is Computer | Computer Full Form | Computer Definition
 
CompFundamentals.ppt
CompFundamentals.pptCompFundamentals.ppt
CompFundamentals.ppt
 
Evo And Gen Of Computers.pptx
Evo And Gen Of Computers.pptxEvo And Gen Of Computers.pptx
Evo And Gen Of Computers.pptx
 
Chapter01
Chapter01Chapter01
Chapter01
 
UNit 1sbhejsjejdhdhdjjejejdhejjjdjdhdhheh.pptx
UNit 1sbhejsjejdhdhdjjejejdhejjjdjdhdhheh.pptxUNit 1sbhejsjejdhdhdjjejejdhejjjdjdhdhheh.pptx
UNit 1sbhejsjejdhdhdjjejejdhejjjdjdhdhheh.pptx
 
Lecture series 1 computer fundamentals
Lecture series 1 computer fundamentalsLecture series 1 computer fundamentals
Lecture series 1 computer fundamentals
 
ENIC Symbols
ENIC SymbolsENIC Symbols
ENIC Symbols
 
SRAS Computer 1
SRAS Computer 1SRAS Computer 1
SRAS Computer 1
 
Introduction to IT
Introduction to ITIntroduction to IT
Introduction to IT
 
Autocad and computer introduction for beginers
Autocad and computer introduction for beginers Autocad and computer introduction for beginers
Autocad and computer introduction for beginers
 
SSC-ICT 7_History of Computer_031810.pptx
SSC-ICT 7_History of Computer_031810.pptxSSC-ICT 7_History of Computer_031810.pptx
SSC-ICT 7_History of Computer_031810.pptx
 
Introduction to computer science ch1
Introduction to computer science ch1Introduction to computer science ch1
Introduction to computer science ch1
 
Introduction to computer.pptx
Introduction to computer.pptxIntroduction to computer.pptx
Introduction to computer.pptx
 
Chapter 1 computer fundamentals
Chapter 1 computer  fundamentalsChapter 1 computer  fundamentals
Chapter 1 computer fundamentals
 
Computer fundamentals
Computer fundamentalsComputer fundamentals
Computer fundamentals
 
Basic Computer Computer notes
Basic Computer Computer notesBasic Computer Computer notes
Basic Computer Computer notes
 
Fundamentals of computers & information system
Fundamentals of computers & information system  Fundamentals of computers & information system
Fundamentals of computers & information system
 
Unit I Foc
Unit I FocUnit I Foc
Unit I Foc
 
Chapter 1.pptx
Chapter 1.pptxChapter 1.pptx
Chapter 1.pptx
 

Recently uploaded

定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Lucknow
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一3sw2qly1
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 

Recently uploaded (20)

Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 

Introduction to CS

  • 2. Overview of Discussion  What is computer science?  What is a computer?  What can computers do?  How do computers solve problems?  What is computer science?  Who invented computers?  Conceptual computers  Computing devices
  • 3. Learning Objectives  Define and use terminology  Examples: computer, computer science, algorithm, specification, correctness, efficiency, von Neumann machine  Distinguish between algorithms and non- algorithms  Know something about the history of computers (up to 1950)
  • 4. Which one is the computer? Rock Calculator Television Modern Airplane Washing Machine Computer Workstation
  • 5. Is it a Computer?  What questions would you ask?  What experiments would you run?
  • 6. Is a rock a computer?  Does not act or process  Takes no input and produces no output  Computers must be able to handle input and output
  • 7. Is a washing machine a computer?  Input: dirty clothes  Output: clean clothes  Does not handle information  Computers input and output information
  • 8. Is a television set a computer?  Input: information from cables or radio waves  Output: information as sound and picture  Does not process information  Computers process information by computing new results and answering queries
  • 9. Is a modern airplane a computer?  Input: information from radio waves  Output: manipulations to the airplane  Can only handle specific information necessary for flight control  Computers are general purpose because they can perform many different tasks
  • 10. Is an ordinary calculator a computer?  Input: numbers and mathematical operations  Output: answer  Handles any numeric task  Cannot remember which buttons are pressed  Computers are programmable so they can remember sequences of operations
  • 11. Definition of a Computer  a general purpose,  programmable,  information processor  with input and output
  • 12. Computing Agents  Definition of computers does not cover all that computer scientists study  Broader class of objects and methods – computing agents  Have some or all of the characteristics of a computer
  • 13. Specialized Computing Devices and Information Appliances  Devices limited by set of operations or programmability  Calculators limited to operations described by their buttons  Global Positioning System (GPS) calculates latitude and longitude from satellite signals  Cell phone allows one to surf the web  Information appliances – performs a single job well
  • 14. Embedded computers and robots  Machines with full-fledged computers inside  Washing machines, airplanes, ATMs, etc.  Such machines require highly reliable, predictable computer programs  All physical mechanisms controlled by computers are robotic devices  Restrict definition to machines that are general purpose and programmable  Robotic arm or cart
  • 15. Natural computing agents  Living organisms process information in their efforts to eat, survive, and reproduce  1940s study showed frogs collect less visual information than people  Identify rapidly moving objects as food, slowly moving objects as predators  Study physical events in terms of information they contain and process  Chemical reactions, crystal formations, plant growth, etc.
  • 16. What is a computer?  Definition of a computer is narrow  Definition of computing agent is broad  Although many computer scientists focus on the computer, some computer scientists deal with computing agents
  • 17. What can computers do – today?  Business productivity managers  Personal information managers  Spreadsheets  Database software  Desktop publishing  Multimedia encyclopedias  Simulate the physical world  Produce a music video
  • 18. What might computers do – tomorrow?  Diagnose diseases  MYCIN captures medical knowledge in rules that allowed a computer to identify an ailment based on symptoms  Control robots that walk, talk, and learn  CMU created a program that drove a van from Pittsburgh to D.C. using cameras for eyes  Compose music and create art
  • 19. How do computers solve problems?  Humans deconstruct problems into small operations that a computer can carry out  Writing an algorithm  Solve a problem by computer requires  State the problem clearly in a problem statement  Solve the problem with an algorithm that gives clear instructions  Use a computing agent to carry out the instructions
  • 20. Stating the problem clearly  Describes what to do, not how to do it  How do I get from Timonium Campus to the Beltway?  Solve general classes of problems  How do I get from point A in Timonium to point B?  What is the square root of y?
  • 21. Specifying a problem  Clear problem statement is called the specification  What information can we use as input  What the output, or solution, to our problem should look like  Specification for the square root problem  Input: A positive number y > 0  Output: A positive number x such that x2 = y  Make sure specification is not ambiguous
  • 22. Solving the problem using an Algorithm  Algorithm – a clear sequence of instructions for performing a task  a well-ordered sequence  of well-defined,  feasible operations  that takes finite time to carry out
  • 23. Finding the square root to the nearest tenth  For this example we are interested in the square root of 55 1. Find the two integers between which √55 lies  Do this by starting at 0 and continuing up through the integers until you find an integer whose square is less than 55 and the next integer has a square larger than 55 2. Find the first estimate by averaging the two integers 3. Divided 55 by the estimate. Compute it to one more place than you want in the final answer 4. Average the estimate and the result of step 3 5. Repeat steps 3 and 4 until the tenth digit does not change
  • 24. Almost Algorithms  To shampoo your hair 1. Rinse 2. Lather 3. Repeat  To set the time on the VCR 1. Open the front panel 2. Push the button 3. Set the hours, then the minutes  To write the Great American Novel 1. Get paper and pencil 2. Sit down 3. Write word on paper 4. If novel is great, quit. Otherwise, go back to step 3.
  • 25. Using the computing agent  The square root algorithm is only an algorithm for an agent that understands English and can perform arithmetic  Requirements imposed by the computing agent  Algorithm is in a language the computing agent understands  Algorithm uses primitive operations that the agent can carry out
  • 26. Necessity of artificial languages  Problems with natural languages (like English)  Flexible  Often ambiguous  Computers use artificial languages with precise meanings  mathematical equations, music notation, programming languages  Programming languages define primitive operations computing agents understand
  • 27. What is computer science?  The study of computers  The study of algorithmic processes including their  Theory  Analysis  Design  Efficiency  Implementation  Application
  • 28. Who invented computers?  Computer science has roots in two fields  Mathematics  Alan Turing and the Turing machine (1930s)  Developed theories with paper and pencil about how to perform computations by hand  Engineering  John von Neumann and the von Neumann machine (1940s)  Showed how to build physical computers out of electronic circuitry
  • 29. Mathematical Roots  Leibniz’s Dream (1600s)  Can we find a universal language for mathematical algorithms that will let us describe and solve any problem?  Reduce all reasoning to a fixed set of basic rules  Determine truth or falsity of sentences by fixed rules for manipulating sentences  George Boole (1800s)  Introduces binary notation of calculation  Computers use binary system for logic and arithmetic
  • 30. More on Theory  David Hilbert (1928)  Challenges the mathematical community to find an infallible, mechanical method for constructing and checking truth of mathematical statements  Interested in an algorithm  Alonzo Church, Alan Turing, and Kurt Gödel construct arguments that there is no solution to Hilbert’s Challenge  Turing builds a conceptual computer for his argument
  • 31. The Turing Machine and the Church- Turing Thesis  Turing Machine  Machine with a finite set of rules and an infinite amount of “scratch paper” for computation  No one has designed a physical computer that can do more than a Turing machine  Machine could not solve Hilbert’s problem  Church-Turning Thesis  The Turing Machine captures what we mean by computational systems  Is as powerful an any other mechanical computing agent
  • 32. Engineering Roots  First step development of calculators  Abacus – developed 5000 years ago in the Middle East  Pascaline – first mechanical calculator using gears for calculation (1642)  Charles Babbage’s Difference Engine – conceptual design that used hundreds of gears to compute mathematical functions (1820s)
  • 33. Electronic Circuits  Telegraph – uses electricity to convey letters and transmit information quickly (1844)  Hollerith Tabulating Machine – Uses electricity and punch cards to calculate the US census (1890)  Z2 – used circuitry to compute arithmetic operations (1930s)
  • 34. Programmed Devices  Jacquard Loom – weaves cloth using a pattern specified using punch cards (1801)  The Analytic Engine – conceptual design for a machine consisting of a Mill, Store, Printer, and Readers  Led Ada Lovelace to define programming concepts such as the subroutine  ENIAC – one of the first programmable electronic computers (1945)  Programmed by routing cables and flipping switches
  • 35. von Neumann Machine  Store programs in electronic memory along side the data (1943)  Move and manipulate a program like data  Enabled high-level programming languages Input Central Processing Unit (CPU) Memory Output
  • 36. Machine Languages  Only language computers directly understand  “Natural language” of computer  Defined by hardware design  Machine-dependent  Generally consist of strings of numbers  Ultimately 0s and 1s  Instruct computers to perform elementary operations  One at a time  Cumbersome for humans  Example: +1300042774 +1400593419 +1200274027
  • 37. Assembly Languages  English-like abbreviations representing elementary computer operations  Clearer to humans  Incomprehensible to computers  Translator programs (assemblers)  Convert to machine language  Example: LOAD BASEPAY ADD OVERPAY STORE GROSSPAY
  • 38. High-level Languages  Similar to everyday English, use common mathematical notations  Single statements accomplish substantial tasks  Assembly language requires many instructions to accomplish simple tasks  Translator programs (compilers)  Convert to assembly language  Interpreter programs  Directly execute high-level language programs  Example: grossPay = basePay + overTimePay
  • 39. Programming Approaches  Structured programming (1960s)  Disciplined approach to writing programs  Clear, easy to test and debug, and easy to modify  Focus on what the program does  Object Oriented programming  Object is an entity characterized by a state and a behavior  state is encoded in the computer program as data  behavior is encoded as methods
  • 40. Objects  Reusable software components that model real world items  Meaningful software units  Date objects, time objects, paycheck objects, invoice objects, audio objects, video objects, file objects, record objects, etc.  Any noun can be represented as an object  More understandable, better organized and easier to maintain than structured programming  Favor modularity  Software reuse  Libraries
  • 41. C++  C++ programs  Built from pieces called classes and functions  C++ standard library  Rich collections of existing classes and functions  “Building block approach” to creating programs  “Software reuse”
  • 42. Basics of a Typical C++ Environment  C++ systems  Program-development environment  Language  C++ Standard Library
  • 43. Basics of a Typical C++ Environment Phases of C++ Programs: 1. Edit 2. Preprocess 3. Compile 4. Link 5. Load 6. Execute Loader Program is created in the editor and stored on disk. Preprocessor program processes the code. Loader puts program in memory. CPU takes each instruction and executes it, possibly storing new data values as the program executes. Compiler Compiler creates object code and stores it on disk. Linker links the object code with the libraries, creates a.out and stores it on disk Editor Preprocessor Linker CPU . . . . . . . . . . . . Disk Disk Disk Disk Disk Edit Compile Run Make Primary Memory Primary Memory