Computation - PowerPoint PPT Presentation

1 / 79
About This Presentation
Title:

Computation

Description:

1834 Charles Babbage's. Analytical Engine ... The picture is of a model built in the late 1800s by Babbage's son from Babbage's drawings. ... – PowerPoint PPT presentation

Number of Views:78
Avg rating:3.0/5.0
Slides: 80
Provided by: Elaine3
Category:

less

Transcript and Presenter's Notes

Title: Computation


1
Computation
2
Binary Numbers
  • Decimal numbers
  • Binary numbers

http//faculty.mc3.edu/pvetere/Applets/APPLETS/NUM
SYS/applet_frame.htm
3
Representing Text
  • Decide how many characters we need to represent.
  • Determine the required number of bits.
  • Ascii 7 bits. Can encode 27 128 different
    symbols.

4
Ascii
http//www.krisl.net/cgi-bin/ascbin.pl
5
Representing Text
Four 01000110 01101111 01110101 01110010
6
When We Need More Characters
What about things like
???
7
When We Need More Characters
What about things like
???
Answer Unicode 32 bits. Over 4 million
characters. http//www.unicode.org/charts/
Answer Unicode 32 bits. Over 4 million
characters. http//www.unicode.org/charts/
8
Digital Images
9
RGB
The red channel
10
RGB
The green channel
11
RGB
Red Green Blue
12
Experimenting with RGB
http//www.cbu.edu/jvarrian/applets/color1/colors
_g.htm
13
Representing Sounds
14
Representing Programs
public static TreeMapltString, Integergt create()
throws IOException public static
TreeMapltString, Integergt create() throws
IOException Integer freq String word
TreeMapltString, Integergt result new
TreeMapltString, Integergt() JFileChooser c
new JFileChooser() int retval
c.showOpenDialog(null) if (retval
JFileChooser.APPROVE_OPTION) Scanner
s new Scanner( c.getSelectedFile()) while(
s.hasNext() ) word s.next().toLowerCase()
freq result.get(word)
result.put(word, (freq null ? 1 freq
1)) return result
15
The Roots of Modern Technology
1834 Charles Babbages
Analytical Engine
Ada writes of the engine, The Analytical Engine
has no pretensions whatever to originate
anything. It can do whatever we know how to order
it to perform.
The picture is of a model built in the late 1800s
by Babbages son from Babbages drawings.
16
Using Logic
  • TaiShanHasTail
  • SmokyHasTail
  • PuffyHasTail
  • ChumpyHasTail
  • SnowflakeHasTail

17
Using Logic
  • Panda(TaiShan).
  • Bear(Smoky).
  • ?x (Panda(x) ? Bear(x).
  • ?x (Bear(x) ? HasPart(x, Tail)).
  • ?x (Bear(x) ? Animal(x)).
  • ?x (Animal(x) ? Bear(x)).
  • ?x (Animal(x) ? ?y (Mother-of(y, x))).
  • ?x ((Animal(x) ? ?Dead(x)) ? Alive(x)).

Does TaiShan have a tail?
18
Search
Start state Goal state
http//www.javaonthebrain.com/java/puzz15/
19
An Aside on Checking Facts on the Web
Who invented the 15-puzzle?
Sam Loyd did (http//www.jimloy.com/puzz/15.htm
) Did he or didnt he (http//www.archimedes-lab.
org/game_slide15/slide15_puzzle.html ) No he
didnt (http//www.cut-the-knot.org/pythagoras/fif
teen.shtml )
20
Breadth-First Search
Is this a good idea?
21
Search
22
More Interesting Problems
The 20 legal initial moves
23
Scalability
Solving hard problems requires search in a large
space.
To play master-level chess requires searching
about 8 ply deep. So about 358 or 2?1012 nodes
must be examined.
24
Growth Rates of Functions
25
Scalability
26
The Advent of the Computer
1945 ENIAC The first electronic digital
computer
27
1949 EDVAC
The first stored program computer
28
Moores Law
http//www.intel.com/technology/mooreslaw/
29
How It Has Happened
30
Can This Trend Continue?
http//www.nytimes.com/2010/08/31/science/31comput
e.html?_r1
31
How Much Computer Power Might It Take?
http//www.frc.ri.cmu.edu/hpm/book97/ch3/index.ht
ml
32
How Much Compute Power is There?
Hans Moravec http//www.frc.ri.cmu.edu/hpm/talks
/revo.slides/power.aug.curve/power.aug.gif
33
Kurweils Vision
http//www.pocket-lint.co.uk/news/news.phtml/12920
/13944/Computers-match-humans-by-2030.phtml
34
Some Other People Agree
http//www.networkworld.com/news/2009/092109-intel
-cto-interview.html
35
Limits to What We Can Compute
  • Are there fundamentally uncomputable things?
  • Does God exist?
  • Whats the best way to run a country?
  • Does this puzzle have a solution?

36
What Can We Do?
  • Can we make all true statements theorems?
  • Can we decide whether a statement is a theorem?

37
The Halting Problem
Program, M input string, w
Does M halt on w?
Yes No
38
A Simple Example
read name if name Elaine then print
You win!! else print You lose ?
39
Another Example
read number set result to 1 set counter to
2 until counter gt number do set result to result
counter add 1 to counter print result
40
Programs Debug Programs
Given an arbitrary program, can it be guaranteed
to halt?
read number set result to 1 set counter to
2 until counter gt number do set result to result
counter add 1 to counter print result
Suppose number 5 result number
counter 1 5 2 2 5 3 6 5 4
24 5 5 120 5 6
41
Changing It a Bit
Given an arbitrary program, can it be guaranteed
to halt?
read number set result to 1 set counter to
2 until counter gt number do set number to number
counter add 1 to counter print result
Suppose number 5 result number
counter 1 5 2 1 10 3 1
30 4 1 120 5 1 600 6
42
How About this One?
Does this program halt on all inputs?
times3(x positive integer) While x ? 1
do If x is even then x x/2. Else x
3x 1.
Lets try it.
43
The Halting Problem Is Undecidable
Program, M input string, w
Does M halt on w?
Yes No
44
Another Undecidable Problem
The Post Correspondence Problem
45
A PCP Instance With a Simple Solution
46
A PCP Instance With a Simple Solution
Solution 3, 4, 1
47
Another PCP Instance
48
Another PCP Instance
49
The Post Correspondence Problem
50
A PCP Instance With No Simple Solution
51
A PCP Instance With No Simple Solution
Shortest solution has length 252.
52
Can A Program Do This?
Can we write a program to answer the following
question
Given a PCP instance P, decide whether or not P
has a solution. Return
True if it does. False if it does not.
53
What is a Program?
54
What is a Program?
A procedure that can be performed by a computer.
55
The Post Correspondence Problem
A program to solve this problem Until a
solution or a dead end is found do If dead end,
halt and report no. Generate the next candidate
solution. Test it. If it is a solution, halt
and report yes. So, if there are say 4 rows in
the table, well try 1 2 3
4 1,1 1,2 1,3
1,4 1,5 2,1 1,1,1 .
56
Will This Work?
  • If there is a solution
  • If there is no solution

57
A Tiling Problem
58
A Tiling Problem
59
A Tiling Problem
60
A Tiling Problem
61
A Tiling Problem
62
A Tiling Problem
63
A Tiling Problem
64
A Tiling Problem
65
A Tiling Problem
66
A Tiling Problem
67
Try This One
68
Another Tiling Problem
69
Another Tiling Problem
70
Is the Tiling Problem Decidable?
Wangs conjecture If a given set of
tiles can be used to tile an arbitrary surface,
then it can always do so periodically. In
other words, there must exist a finite area that
can be tiled and then repeated infinitely often
to cover any desired surface. But Wangs
conjecture is false.
71
Important Issues
  • The halting problem is undecidable.
  • Theres no black box reasoning engine for
    standard logic.
  • Would quantum computing change the picture?
  • Does undecidability doom our attempt to make
    artificial copies of ourselves?

72
Is Decidability Enough?
73
The Traveling Salesman Problem
15
25
10
28
20
4
8
40
9
7
3
23
Given n cities and the distances between each
pair of them, find the shortest tour that returns
to its starting point and visits each other city
exactly once along the way.
74
The Traveling Salesman Problem
15
25
10
28
20
4
8
40
9
7
3
23
Given n cities Choose a first city n Choose
a second n-1 Choose a third n-2 n!
75
The Traveling Salesman Problem
Can we do better than n! ? First city
doesnt matter. ? Order doesnt matter. So
we get (n-1!)/2.
76
The Growth Rate of n!
77
Growth Rates of Functions, Again
78
Putting it into Perspective
79
Does Complexity Doom AI?
Write a Comment
User Comments (0)
About PowerShow.com