1 / 104

# Computation - PowerPoint PPT Presentation

Computation. Binary Numbers. Decimal numbers Binary numbers. http://faculty.mc3.edu/pvetere/Applets/APPLETS/NUMSYS/applet_frame.htm. Text.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'Computation' - katen

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Computation

• Decimal numbers

• Binary numbers

http://faculty.mc3.edu/pvetere/Applets/APPLETS/NUMSYS/applet_frame.htm

Computers have revolutionized our world. They have changed the course of our daily lives, the way we do science, the way we entertain ourselves, the way that business is conducted, and the way we protect our security.

Computers have revolutionized our world. They have changed the course of our daily lives, the way we do science, the way we entertain ourselves, the way that business is conducted, and the way we protect our security.

Les ordinateurs ont révolutionné notre monde. Ils ont changé le cours de notre vie quotidienne, notre façon de faire la science, la façon dont nous nous divertissons, la façon dont les affaires sont menées, et la façon dont nous protégeons notre sécurité.

Computers have revolutionized our world. They have changed the course of our daily lives, the way we do science, the way we entertain ourselves, the way that business is conducted, and the way we protect our security.

Les ordinateurs ont révolutionné notre monde. Ils ont changé le cours de notre vie quotidienne, notre façon de faire la science, la façon dont nous nous divertissons, la façon dont les affaires sont menées, et la façon dont nous protégeons notre sécurité.

• Decide how many characters we need to represent.

• Determine the required number of bits.

• Ascii: 7 bits. Can encode 27 = 128 different symbols.

http://www.krisl.net/cgi-bin/ascbin.pl

F o u r

01000110 01101111 01110101 01110010

T h e n u m b e r i s 1 7 .

54 68 65 20 6E 75 6D 62 65 72 20 69 73 20 31 37 2E

Answer: Unicode: 32 bits. Over 4 million characters.

http://www.unicode.org/charts/

A conversion applet:

http://www.pinyin.info/tools/converter/chars2uninumbers.html

Computers have revolutionized our world.

Computers have revolutionized our world.

Computers have revolutionized our world.

Computers have revolutionized our world.

Computers have revolutionized our world.

if word_count(text) > 5000:

return(“Done!!”)

else:

return(“No sleep yet.”)

if word_count(text) > 5000:

return(“Done!!”)

else:

return(“No sleep yet.”

display = render(text, font)

Computers have revolutionized our world.

Now we must turn this 2-dimensional bit matrix into a string of bits.

0000110000 0001111000 0011111100

0111111110 0111111110 0111111110

0111001110 0111001110 0111001110 0111001110

The red channel

The green channel

Red Green Blue

http://www.jgiesen.de/ColorTheory/RGBColorApplet/rgbcolorapplet.html

public static TreeMap<String, Integer> create() throws IOException

public static TreeMap<String, Integer> create() throws IOException

{ Integer freq;

String word;

TreeMap<String, Integer> result = new TreeMap<String, Integer>();

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;

}

}

Forsythe-Edwards Notation

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

http://en.wikipedia.org/wiki/Forsyth-Edwards_Notation

It’s just a string:

AUGACGGAGCUUCGGAGCUAG

1834 Charles Babbage’s

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 Babbage’s son from Babbage’s drawings.

• TaiShanHasTail

• SmokyHasTail

• PuffyHasTail

• ChumpyHasTail

• SnowflakeHasTail

• 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))).

Does TaiShan have a tail?

Start state Goal state

http://www.javaonthebrain.com/java/puzz15/

The word heuristic comes from the Greek word  (heuriskein), meaning “to discover”, which is also the origin of eureka, derived from Archimedes’ reputed exclamation, heurika (“I have found”), uttered when he had discovered that the volume of water displaced in the bath equals the volume of whatever (him) got put in the water. This could be used as a method for determining the purity of gold.

The word heuristic comes from the Greek word  (heuriskein), meaning “to discover”, which is also the origin of eureka, derived from Archimedes’ reputed exclamation, heurika (“I have found”), uttered when he had discovered that the volume of water displaced in the bath equals the volume of whatever (him) got put in the water. This could be used as a method for determining the purity of gold.

A heuristic is a rule that helps us find something.

Who invented the 15-puzzle?

Sam Loyd did: (http://www.jimloy.com/puzz/15.htm)

Did he or didn’t he:

(http://www.archimedes-lab.org/game_slide15/slide15_puzzle.html)

No he didn’t: (http://www.cut-the-knot.org/pythagoras/fifteen.shtml)

Is this a good idea?

The 20 legal initial moves

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.

How?

c1 * material +

c2 * mobility +

c3 * king safety +

c4 * center control + ...

Computing material:

Pawn     100    Knight    320    Bishop   325    Rook     500    Queen    975    King      32767

1945 ENIAC The first electronic digital computer

1948 Modified to be a stored program machine

Possibly the first stored program computer

http://www.intel.com/technology/mooreslaw/

http://www.nytimes.com/2010/08/31/science/31compute.html?_r=1

http://www.frc.ri.cmu.edu/~hpm/book97/ch3/index.html

Hans Moravec: http://www.frc.ri.cmu.edu/~hpm/talks/revo.slides/power.aug.curve/power.aug.gif

http://www.pocket-lint.co.uk/news/news.phtml/12920/13944/Computers-match-humans-by-2030.phtml

http://www.networkworld.com/news/2009/092109-intel-cto-interview.html

Are there fundamentally uncomputable things?

• Does God exist?

• What’s the best way to run a country?

• Does this puzzle have a solution?

• Can we make all true statements theorems?

• Can we decide whether a statement is a theorem?

Program, M

input string, w

Does M halt on w?

Yes

No

if name = “Elaine”

then print “You win!!”

else print “You lose ”

set result to 1

set counter to 2

until counter > number do

set result to result * counter

print result

Given an arbitrary program, can it be guaranteed to halt?

set result to 1

set counter to 2

until counter > number do

set result to result * counter

print result

Suppose number = 5:

resultnumber counter

1 5 2

2 5 3

6 5 4

24 5 5

120 5 6

Given an arbitrary program, can it be guaranteed to halt?

set result to 1

set counter to 2

until counter > number do

set number to number * counter

print result

Suppose number = 5:

resultnumber counter

1 5 2

1 10 3

1 30 4

1 120 5

1 600 6

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.

Let’s try it.

Program, M

input string, w

Does M halt on w?

Yes

No

The Post Correspondence Problem

Solution: 3, 4, 1

Shortest solution has length 252.

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.

A procedure that can be performed by a computer.

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, we’ll try:

1 2 3 4

1,1 1,2 1,3 1,4 1,5

2,1 ……

1,1,1 ….

• If there is a solution:

• If there is no solution:

Wang’s 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 Wang’s conjecture is false.

• The halting problem is undecidable.

• There’s 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?

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.

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!

Can we do better than n!

● First city doesn’t matter.

● Order doesn’t matter.

So we get (n-1!)/2.