What is this thing mortals call "Artificial Intelligence?" Broadly speaking, it's when computers can (or give the illusion of being capable of) intelligent thought and reasoning ability. Alan Turing and the Turing Test: Behind one door is a human. Behind another is a computer. You can ask any question you like to either door as much as you like, and when you're ready, you have to guess which is the human and which is the computer. If the players can guess correctly no more than half the time, the computer is said to be "intelligent" according to Turing. Amazing Accomplishments of AI: Auditory language processing. "An arrow flight" "A narrow flight" Deep Blue: A chess program from the 1990's that beat then world champion Garry Kasparov. AI programs at its most basic level are not doing anything that other computers are incapable of. It's still running programs that boil down to ifs and loops and methods and variables and everything else. Sometimes what Artificial Intelligence does involves a remarkably simple stategy that surprisingly works. ("heuristic"). ("Heuristic Algorithmic Computer" HAL, the AI in "2001: A Space Odyssey"). Watson: Easily defeated Ken Jennings at Jeopardy! In the end, Watson' strategy was remarkably simple. Watson had a full encyclopedia in its data banks. What Watson would do, would analyze the "important" words in a question, and locate within the encyclopedia those sections where these words are in proximity to each other. Then would for OTHER words also in proximity, and the word that appeared most often would be Watson's guess. Category: U.S. Cities Its largest airport is named for a World War II commander and its second largest is named for a World War II battle. What is Chicago? What is Toronto? "What does this prove? Does this prove that a computer is smarter than Ken Jennings?" "It doesn't understand the meanings of the questions. All it does is search for words." AI is a broad subject that covers a great many things. It has been around for decades. We will not cover it all. A lot of we will be covering will be relatively basic compared to what's there out there now. I would LOVE to make it to Neural Networks by the end of the semester. Three-Dimensional Tic-Tac-Toe (Backup Game: Toe-Tac-Tic). 3x3x3 Tic-Tac-Toe. How many ways are there to win? 49. There are 8 ways to win regular tic-tac-toe. There are nine planes within 3-d tic-tac-toe. 8x9=72 But, orthogonal row has been counted twice. Each plane consists of 6 orthogonal rows, A total of 54, but there really only 27, each counted twice, so 72-27 is 45. So where the other four? The four diagonal paths that aren't on a single plane; the ones that connect completely opposite corners. ( (n+2)^d - n^d ) / 2 is the number of ways to win at tic tac toe, where n is the number of squares on each side, and d is the number of dimensions. (5^3 - 3^3)/2 = (125-27)/2 = 98/2 = 49. Your first assignment will be to program a 3-d tic tac toe game so that the computer will play against the human (but without strategy) and the program should be able to detect who wins or with neither win. SIDE NOTE: In a loop, if you're on a plane (or you're looking at 2-d matrix), what's an EASY to test all eight directions from where you are? x and y are my current position for dx = -1 to 1 for dy = -1 to 1 if (dx==0 && dy==0) skip this one Do what you need to do with (x+dx) and (y+dy) All eight directions have been processed. Second program will be to give the computer a Minimax algorithm. The advantage of this is that it's easy to understand and doesn't require a whole lot of math. The downside is that it can be slow...because you're effectively checking every possible g The idea is that if you're the computer you want to pick the square that gives you a definite win. If there is more than one such square, you want to pick the square that will give you a win in the least number of moves. If there is no such square that guarantees a win, then you want to pick a square that will force a tie. If there is no square that will force a win or a tie, then you want the square that will require the most moves before you lose. The computer understands that the other player is trying to do the same thing. So, when the computer plans its move, it uses RECURSION to emulate the other player, understanding that the other player is also playing to win. So, COMPUTER says: What happens if I move to position A? Well, I'll use recursion to place a piece in position A and run the same method as though the other player is playing to win. If recursion "Yay! I win!" then I feel I probably shouldn't put my piece there, because the other player will win if I do. If the other player returns "Aw! I lose!" than I should think that maybe this would be a good move for me. And so forth. The code is actually quite short.