Quick work: Memory allocation

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

1 QUIZ: P1=15 KB, P2=5 KB, P3=30 KB Worst-fit Best-fit First-fit

2 Chapter 13 13.1 Thinking Machines

Can you list the items in this picture?

Courtesy of Amy Rose.

4 Thinking Machines

Can you • Count the distribution of letters in a book? • Add a thousand 4-digit numbers? • Match fingerprints? • Search a list of a million values for duplicates?

5 Thinking Machines

Humans do best Computers do best

• Counting • Image processing • Operating fast with • Language large numbers • Strategy • Searching, sorting • Learning • Matching patterns

6 Artificial intelligence (AI) AI = the study of computer systems that model and apply the intelligence of the human (animal) mind Examples: • Writing a program to pick out objects in a picture • Navigate to the nest using landmarks • Play backgammon, chess, go, …

7 Not in text 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]

8 Not in text AI and strategy board games See more links on the webpage www.agapie.net  News from AI and Robotics

9 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 chess player. D. A computer has beaten the best human go player. E. A computer has beaten the best human poker player.

10 The “ultimate goal” of AI (?)

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 during WWII! He proposed a test that could answer the question

11 The

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

12 The Turing Test The first practical instantiation of the Turing test, held annually since 1991! = programs designed to carry on a conversation with a human user

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

13 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 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 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, , considered it to have passed Turing's test.

Source: https://en.wikipedia.org/wiki/Eugene_Goostman

15 Not in text Strategies for passing the Turing Test Weak equivalence Two systems (human and computer) are equivalent in results (output), but they do not arrive at those results in the same way Strong equivalence Two systems (human and computer) use the same internal processes to produce results

16 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.

17 Semantic Networks

Semantic network/net = A knowledge representation technique that focuses on the relationships between objects. A directed graph is used to represent a semantic net.

Remember directed Graphs from Ch.8?

18 Semantic Networks

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

What questions can we not ask?

19 Solution What 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?

20 QUIZ

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

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

21 Not in text Prolog: a language dedicated to Semantic Networks!

Visual representation of the S.N.

Prolog code

22 Not in text Prolog: a language dedicated to Semantic Networks!

Who are Jim’s ancestors?

23 Not in text Prolog: a language dedicated to Semantic Networks!

Who are Jim’s female ancestors?

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

24 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!

25 Search Trees Search 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?

26 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.

27 Is this a binary tree?

28 Nim

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

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

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

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

Does the first player have a winning strategy?

32 Quick work for next time • 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?

33 Search Trees Search 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.

34 Techniques for pruning Search Trees

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

Remember DFS from Ch.8?

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

35 DFS vs. BFS example

Figure 13.5 Depth-first and breadth-first searches

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

Skip the remainder of Ch.13, starting with 13.3 Expert Systems

37 Read bio: Who am I?

• My Ph.D. was in Political Science, not ! • I coined the term “bounded rationality” in 1947. • I received the Nobel prize in economics and the Turing award (in CS)!

38 Not a homework, do not turn in!

Practice/review problems for Ch.13: • 6 through 12 • 22 through 35 • 37, 38, 39, 42 through 45

39