CS 40 - Lecture 9

Cay S. Horstmann
Lecture 8 Recap

- object: item that can be manipulated in program (has instance
variables, methods)
- class: set of objects with the same behavior
- instance of a class: an object of the class
Artificial Intelligence
- What is artificial intelligence?
- It is the science and engineering of making intelligent machines,
especially intelligent computer programs.
- What is intelligene?
- Intelligence is the computational part of the ability to achieve
goals in the world. Varying kinds and degrees of intelligence occur in
people, many animals and some machines.
Source: John McCarthy, What is Artificial Intelligence, http://www-formal.stanford.edu/jmc/whatisai/
Example: DARPA Challenge

- Challenge: Build autonomous car (no human inside, no remote
control)
- 2004, Mojave Desert: None got past 5% of the course
- 2005, Beer Bottle Pass: Five cars made the entire 212 km (132 mi), the
winner (Stanford's Stanley) in just under 7 hours
- November 3, 2007, Victorville: Urban Challenge (http://www.darpa.mil/grandchallenge/index.asp).
Drive through traffic
- Why the competition? (a) Obvious military use (b) Get American students
excited about engineering
Example: Computer Chess

- Chess: Simple rules, but playing well is a challenge to most humans
- 1996: Deep Blue defeats world champion Garry Kasparov
- Extensive research on how humans play chess: planning, experience,
intuition
- Chess programs try huge numbers of moves very quickly
- Are they intelligent?
Lab: Game of NIM
- You and the computer take turns taking marbles from pile. Each player
takes at least 1 but at most half the marbles. Whoever is stuck with one
marble loses.
- Try it out. Run the nim.a2w program in Alice. I
used a combolock to indicate the number of marbles. Use left, right arrow
key to turn, Enter key to mark your selection.
- Did you (1) win or (2) lose? ActiveLecture.org
- Look at the program (Cleopatra.play). Is this intelligence?
- For more exciting variation, go to http://www.2020tech.com/fruit/
Rule-Based Systems
- Use the power of logic
- Ingredients: (a) Facts (b) Rules of the form
if A then
B
- Advantage: Deductions are provably correct
- Applications: Credit rating, airline seat pricing, oil drilling, legal
case analysis, automated stock trading, medical diagnostics
Probabilistic Methods
- Take probabilities into account
- Example: 95% probabilitiy that it will rain tomorrow
- Bayesian filtering, fuzzy logic
- Example: Spam filter computes prob. that message is spam, based on
known probs. that words are contained in spam messages
Neural Networks

- Neural network: simulation of set of neurons in the brain
- Each connection has a weight factor
- Node is fired if sum of weighted inputs > 1
- Training phase: adjust weights if output not correct
- Example: Voice recognition
Lab: ELIZA
- Computer simulation of psychiatrist
- Joseph Weizenbaum 1966 (!)
- http://chayden.net/eliza/Eliza.html
- Try it out and have a dialog for a few minutes. What do you think?
ActiveLecture.org
- Very convincing
- Must have been impressive in 1966
- Lame
Unsolved Challenges

- Language translation
- Accurate speaker-independent voice recognition
- Face recognition
- Proving mathematical theorems
- Giving useful advice
- Turing Test
What Works Today

- Resume scanning
- Credit card fraud detection
- Electronic pets
- Simple appliances
Ethical Issues
- You didn't get the interview/loan because the software rejected you.
What is your recourse?
- The autonomous car ran over your dog. Who is liable?
- Face-recognizing cameras in all public spaces—surveillance
society?
- SJSU in 50 years: Replace “expensive” faculty with
software?
Your Turn
With your partner, formulate an ethical/societal issue related to the use
of AI and write it here. ActiveLecture.org
Reminders

- Homework #3 is due next Tuesday
- Exam #1 is next Thursday
- Is your photo in eCampus? If not, please put it there.
- Start thinking about projects.
- Possible Topics:
- Program something in Alice
- Do something with movies (following the book)
- Do research on social impact of computing