Technicalities

Download Report

Transcript Technicalities

CPS1 : Perspectives on
Computer Science
Wrap-up and Review
Technicalities
• Computers are machines
• Everything is the presence or absence of
current
• Everything in the computer is
– On / Off
–1/0
– True / False
Technicalities
• Just 1’s and 0’s represent letters and
numbers
• Circuits are made to represent logic
– AND
– OR
– NOT
Architecture
• Computer is made of registers, cache, main
memory, I/O devices, and processor
• Registers include Instruction Pointer,
Instruction Register, Condition Flag,
Computation Register
• Instructions are read in from memory and
executed
Compilers
• Compilers interpret higher-level code into
machine instructions
• They allow us to program in a more
intuitive way
• Work with Grammars that substitute
symbols from one language into another
Technical Problem-Solving
• Algorithms: Detailed instructions for
solving a problem
• Code: Writing algorithms such that
computers can understand them
• Can be written in higher-level languages
than Assembly
Technical Problem-Solving
• Code principles:
– Computers follow details step by step
– Use names to identify things (variables,
subroutines)
– Use logic to control the order of instructions
– Use loops to do instructions an indefinite
number of times
Technical Problem-Solving
• We use recursion to write algorithms more quickly
• It seems like “magic” that we can assume part of
the job gets done for us, …
• … But it works because we call the subroutine on
smaller and smaller problems until we hit the base
case!
• This is one way to model a problem-solving
technique
Using Models
• We learn how to model knowledge and
problem-solving techniques using computer
principles
• One model is a decision tree – to model a
decision making process that uses a process
of elimanation
Using Models
• Data is organized and represented as well
• We have certain ways of organizing data so that
we can access it without disturbing the structure
• Examples
–
–
–
–
–
–
Stacks
Queues
Trees
Graphs
Lists
Tables
Using Models
• We learn to do certain things with these structures
that are general enough to be used in lots of
problems
– Sorting
•
•
•
•
Quicksort
Mergesort
Insertion Sort
Bucket Sort
– Searching
• Sequential
• Binary
Analysis of Algorithms
• Once we have many ways to solve a
problem, we can analyze them to see which
work best in which situation
– Worst-case
– Average Case
– Best Case
Applications
Now that we have lots of tools at our disposal,
we can build real applications that do
useful things
Simulations
–
–
–
Help predict the future
Prevent costly and dangerous human
experimentation
Gather statistics quickly and easily
The OS
• One such Application is the Operating
System
• Manages other applications’ resource
allocation and time sharing
• Bootstraps the computer when it is powered
on
• Allows a friendly, easy user interface to
other applications
Security
•
•
•
•
Having applications that work on private
data and do non-trivial things raises the
need for security
Security provided by encrypting messages
Uses public and private keys
Use math theory to gain trust
The Nature of Computers
• After programming as much as we know
how, we can make some statements about
the nature of things that computers can do
– Computers run algorithms (detailed, specific)
– Computers not good at things that are innate to
humans
– Computers have memory, speed, and accuracy
that humans don’t have
AI
• This leads us to try to push the boundaries of what
computers are good at
• We try to gain computer “intelligence”
• Can computers think?
• Can computers interact the way humans do?
–
–
–
–
Walk
Talk
See
Feel
Leads us to…
• Questions of philosophy (What it means to
be human)
• Questions of sociey (What impacts, good
and bad, does this have on our lives?)
• Questions of ethics (What new laws should
be put into effect to help us? What is right
and wrong?)