39
Quick work: Memory allocation 1 The OS is using a fixed partition algorithm. Processes place requests to the OS in the following sequence: P1=15 KB, P2=5 KB, P3=30 KB Draw the memory map at the end, if each of the following algorithms is in use: Worst-fit First-fit Best-fit

Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

Quick work: Memory allocation

1

The OS is using a fixed partition algorithm.Processes place requests to the OS in the following sequence:

P1=15 KB, P2=5 KB, P3=30 KB

Draw the memory map at the end, if each of the following algorithms is in use:• Worst-fit• First-fit• Best-fit

Page 2: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

QUIZ:P1=15 KB, P2=5 KB, P3=30 KB

2

Worst-fit Best-fit First-fit

Page 3: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

Chapter 13

Artificial Intelligence

Page 4: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

4

13.1 Thinking Machines

Can youlist the items

in thispicture?

Courtesy of Amy Rose.

Page 5: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

5

Thinking Machines

Can you• Count the distributionof letters in a book?

• Add a thousand 4-digit numbers?

• Match fingerprints?• Search a list of amillion values forduplicates?

Page 6: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

6

Thinking Machines

• Image processing• Language• Strategy• Learning

Humans do best Computers do best

• Counting• Operating fast with

large numbers• Searching, sorting• Matching patterns

Page 7: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

7

Artificial intelligence (AI) AI = the study of computer systems that model and apply the intelligence of the human (animal) mindExamples:

• Writing a program to pick out objects in a picture

• Navigate to the nest using landmarks

• Play backgammon, chess, go, …

Page 8: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

8

AI and strategy board games• July 1979, BKG 9.8 was strong enough to play against the reigning backgammon world champion Luigi Villa. It won the match, 7–1, becoming the first computer program to defeat a world champion in any board game. [http://en.wikipedia.org/wiki/Backgammon]

• Deep Blue versus Garry Kasparov was a pair of famous six-game human–computer chess matches, in the format of machine and humans, versus a human. In this format, on the machine side a team of chess experts and programmers manually alter engineering between the games. The first match was played in 1996, and Kasparov won 4–2. A rematch was played in 1997 – this time Deep Blue won 3½–2½. [http://en.wikipedia.org/wiki/Deep_Blue_versus_Garry_Kasparov]

• AlphaGo versus Ke Jie was a three-game Go match between the computer Go program AlphaGo and current world No. 1 ranking player Ke Jie, played in May 2017. AlphaGo won 3-0. [https://en.wikipedia.org/wiki/AlphaGo_versus_Ke_Jie]

Not in text

Page 9: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

9

AI and strategy board gamesSee more links on the webpage

www.agapie.net News from AI and Robotics

Not in text

Page 10: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

QUIZ: True or false?A. A computer has beaten the best human checkers

player.

B. A computer has beaten the best human backgammon player.

C. A computer has beaten the best human chessplayer.

D. A computer has beaten the best human go player.

E. A computer has beaten the best human pokerplayer.

10

Page 11: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

11

Turing test = A test to empirically determine whether a computer has achieved (human) intelligence

Alan Turing English mathematician who wrote a landmark paper in 1950 that asked the question: Can machines think?

– Yes, the same guy who worked at Bletchley Park during WWII!

He proposed a test that could answer the question

The “ultimate goal” of AI (?)

Page 12: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

12

The Turing Test

Figure 13.2 In a Turing test, the interrogator must determine which respondent is the computer and which is the human

Page 13: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

13

The Turing TestLoebner prizeThe first practical instantiation of the Turing test, held annually since 1991!

Chatbots = programs designed to carry on a conversation with a human user

Has any chatbot won the Loebner Prize yet? Read the Wikipedia article: https://en.wikipedia.org/wiki/Loebner_Prize

Page 14: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

Try talking with one of the following chatbots:

• http://www.alicebot.org/

• http://www.jabberwacky.com/

• http://www.princetonai.com/bot/

• http://www.cleverbot.com/

• http://www.simsimi.com/

Read more: http://en.wikipedia.org/wiki/Chatterbot

Page 15: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

A program passed the Turing Test!On 7 June 2014, at a contest marking the 60th

anniversary of Turing's death, 33% of the event's judges thought that the program Eugene Goostman was human after 5 minutes of interacting with it.

Turing's prediction in his 1950 paper Computing Machinery and Intelligence, was that, by the year 2000, machines would be capable of fooling 30% of human judges after five minutes of questioning.

The event's organizer, Kevin Warwick, considered it to have passed Turing's test.Source: https://en.wikipedia.org/wiki/Eugene_Goostman

15

Page 16: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

16

Strategies for passing the Turing Test

Weak equivalenceTwo systems (human and computer) are equivalent in results (output), but they do not arrive at those results in the same way

Strong equivalenceTwo systems (human and computer) use the same internal processes to produce results

Not in text

Page 17: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

17

13.2 Knowledge Representation

• We need to create a logical view of the data, based on how we want to process it

• Natural language is very descriptive, but does not lend itself to efficient processing

• Semantic networks and search trees are promising techniques for representing knowledge.

Page 18: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

18

Semantic NetworksSemantic network/net = A knowledge representation technique that focuses on the relationships between objects.

A directed graph is used to represent a semantic net.

Remember directedGraphs from Ch.8?

Page 19: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

19

Semantic Networks

What questions can we ask about the data in this network?

What questions can we not ask?

Page 20: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

20

SolutionWhat questions can we ask about the data in this network?• Is John male?• Does Mary have an eye

color?• How many students live in

Heritage Acres?

What questions can we not ask?• Is John a good student?• Do Mary and John know each other?

Page 21: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

QUIZ

21

• Do whales have vertebrae?• Are there 2 or more animals that have fur?• Do bears live in water?

What would a computer answer, based solely on this S.N.?

Page 22: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

22

Prolog: a language dedicated toSemantic Networks!

Not in text

Prolog code

Visual representation of the S.N.

Page 23: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

23

Not in text

Who are Jim’s ancestors?

Prolog: a language dedicated toSemantic Networks!

Page 24: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

24

Not in text Prolog: a language dedicated toSemantic Networks!

In order to answer this, we need to add more information to our model!

Who are Jim’s female ancestors?

Page 25: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

25

Designing Semantic Networks• The objects in the network represent the objects in the

real world that we are representing• The relationships that we represent are based on the

real world questions that we would like to ask• That is, the types of relationships represented

determine which questions are easily answered, which are more difficult to answer, and which cannot be answered

• Challenges:– Find the relationships that relevant to the problem!– Populate the network with all data needed!

Page 26: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

26

Search TreesSearch tree = structure that represents alternatives in adversarial situations such as game playing

The paths down a search tree represent a series of decisions made by the players

Remember Trees from Ch.8?

Page 27: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

27

Nim

Figure 13.4 A search tree for a simplified version of Nim: Five spaces total, each player (X and 0) places 1, 2, or 3 symbols from Left to Right. Player to place last symbol wins.

Page 28: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

28

Is this a binary tree?

Page 29: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

29

Nim

For each leaf, decide which player has won!Does the first player have a winning strategy?

Page 30: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

30

Your turn! Draw the tree for the Nim game with 4 positions and either 1 or 2 symbols

Page 31: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

31

Search tree for the Nim game with 4 positions and either 1 or 2 symbols

Page 32: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

32

Search tree for the Nim game with 4 positions and either 1 or 2 symbols

Does the first player have a winning strategy?

Page 33: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

Quick work for next time

33

• Draw the search tree for the Nim game with 5 positions either 1 or 2 symbols per turn.

• Does the first player have a winning strategy?• Does the second player have one?

Page 34: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

34

Search TreesSearch tree analysis can be applied to other, more complicated games such as chess.However, the full analysis of the chess search tree would take many lifetimes of the Universe! (on today’s fastest supercomputers!)Because these trees are so large, only a fraction of the tree can be analyzed in a reasonable time.Therefore, we must find a way to intelligently prune the tree.

Page 35: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

35

Techniques for pruning Search Trees

Depth-first search down the paths of a tree prior to searching across levels

Breadth-first search across levels of a tree prior to searching down specific paths • Breadth-first tends to yield the best results

Remember DFS from Ch.8?

Page 36: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

36

DFS vs. BFS example

Figure 13.5 Depth-first and breadth-first searches

Page 37: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

37

This is the end of the material covered in our course!

Skip the remainder of Ch.13, starting with13.3 Expert Systems

Page 38: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

38

Read bio: Who am I?• My Ph.D. was in Political

Science, not Computer Science!

• I coined the term “bounded rationality” in 1947.

• I received the Nobel prize in economics and the Turing award (in CS)!

Page 39: Quick work: Memory allocation · Artificial intelligence(AI) AI = the study of computer systems that ... Machinery and Intelligence, was that, by the year 2000, machines would be

Practice/review problems for Ch.13:

• 6 through 12

• 22 through 35

• 37, 38, 39, 42 through 45

39

Not a homework, do not turn in!