DW Daniel High, SC; Jan 25, 2010 Murali Sitaraman

Slides:



Advertisements
Similar presentations
Announcements You survived midterm 2! No Class / No Office hours Friday.
Advertisements

Adversarial Search We have experience in search where we assume that we are the only intelligent being and we have explicit control over the “world”. Lets.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Computer Science School of Computing Clemson University A bit of Computer Science is good for you no matter what you want to do DW Daniel High, SC; Jan.
Big Oh CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University of Wisconsin.
Hexahexaflexagon Automata Paul Curzon Queen Mary University of London With support from Google,
WHAT IS COMPUTER SCIENCE? Phil Sands K-12 Outreach Coordinator for Computer Science.
Introductory Lecture. What is Discrete Mathematics? Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous)
INTRODUCTION TO COMPUTER SCIENCE. SNAP! Open Chrome Whack a Mole Phone App in 3 minutes
CS 111 – Aug. 26 Review: How might an airline use IT? Chapter 0 –Computer origins –Algorithms –Abstraction Commitment for next day: –Please read section.
CMSC 104, Version 8/061L24Searching&Sorting.ppt Searching and Sorting Topics Sequential Search on an Unordered File Sequential Search on an Ordered File.
Adversarial Search and Game-Playing
CST 1101 Problem Solving Using Computers
Introduction: Computer programming
Introductory Game Theory
FLOWCHARTS Part 1.
CompSci 101 Introduction to Computer Science
Introduction to Randomized Algorithms and the Probabilistic Method
Great Theoretical Ideas in Computer Science
Intro to Computer Science II
Defining Rules and Levels of Rules (Chs. 11 & 12)
Algorithms Detour - Shortest Path
Intro to Computer Science CS1510 Dr. Sarah Diesburg
IGCSE 6 Cambridge Effectiveness of algorithms Computer Science
UNIT 2 – LESSON 6 ENCODE AN EXPERIENCE.
CompSci 101 Introduction to Computer Science
CS Fall 2016 (Shavlik©), Lecture 11, Week 6
Adversarial Search.
IPad Center.
AlphaGo and learning methods
David Kauchak CS52 – Spring 2016
C ODEBREAKER Class discussion.
Enough Mathematical Appetizers!
CS 4700: Foundations of Artificial Intelligence
Trees 4 The B-Tree Section 4.7
AlphaGo and learning methods
Complexity Introduction Complexity ©D.Moshkovitz.
Learning to program with Logo
Foundations of Computer Science
ASU 101: The ASU Experience Computer Science Perspective
Mastery Unlocked Session 4: Fluency.
2008/12/03: Lecture 20 CMSC 104, Section 0101 John Y. Park
Announcements P2 is due tomorrow Prelim on Monday
Searching and Sorting Topics Sequential Search on an Unordered File
CompSci 101 Introduction to Computer Science
Game playing.
Computational Thinking
Binary Search and Intro to Sorting
Prof. Ramin Zabih Least squares fitting Prof. Ramin Zabih
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Searching and Sorting Topics Sequential Search on an Unordered File
UNIT 3 CHAPTER 1 LESSON 4 Using Simple Commands.
Last Class We Covered Sorting algorithms Searching algorithms
Applied Discrete Mathematics Week 6: Computation
Searching and Sorting Topics Sequential Search on an Unordered File
Topic 1: Problem Solving
CS 416 Artificial Intelligence
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Breakfast Bytes Easy, Hard, and Impossible
Introduction to Discrete Mathematics
Discrete Mathematics in the Real World
CSE 373 Data Structures and Algorithms
Becoming a Good Test Taker
Getting to the bottom, fast
Directions to play game
CS51A David Kauchak Spring 2019
Artificial Intelligence Machine Learning
Unit II Game Playing.
Interesting Algorithms for Real World Problems
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

A bit of Computer Science is good for you no matter what you want to do DW Daniel High, SC; Jan 25, 2010 Murali Sitaraman RESOLVE Software Research Group Google Terms: Clemson RESOLVE School of Computing, Clemson murali@clemson.edu

Acknowledgments Fox Filmed Entertainment Marvel Studios New York Times (Jan 24, 2010) Software Development Topics, Timm Martin 1001Crash.com US National Science Foundation

Computer Science is fun

Computer Science is fun

Computer Science is everywhere

Computer Science is everywhere

Computer Science is everywhere

CS is serious business Link

CS is serious business

CS is serious business

CS has applications everywhere Arts Math Medicine Physical Sciences Engineering Finances and management … So job prospects are excellent with some computer science, but this talk is not about that

What you learn in CS CS is as much about computers as teaching is about blackboards Not just about games or programming Something a lot more fundamental… Abstraction Analysis Mathematical logic Problem solving These fundamentals will help you no matter what your major is

Let’s play

Let’s play tic-tac-toe Play with your friend a few times Figure out a strategy

Let’s play tic-tac-toe Play with your friend a few times Figure out a strategy (“algorithm”) Can you always win? Do you always lose?

Do the colors matter?

Do the shapes matter?

What matters?

Abstraction For the present problem Understand what is relevant Ignore the irrelevant It is the only way we can get a handle on large, complex problems There is a huge gap between the problems and the electrons running around in the computers There are several layers of abstraction Electrons, bits, bytes, programs are all abstractions!

Strategies for solving tic-tac-toe Pick the middle square, if it is not taken ???

Strategies for solving tic-tac-toe If it is not taken Pick the middle square Pick a square if it would stop the other person from winning ???

Strategies for solving tic-tac-toe If it is not taken Pick the middle square Pick a square if you would lose by not picking it! Pick a square if it would help you win!!

A step-by-step procedure If it is not taken Pick a square if it would help you win!! Pick a square if you would lose by not picking it! Pick the middle square Pick a corner square (any one?) Pick a center-edge square (any one?) ???

A program Repeat the following steps forever 1. If it is not taken Pick a square if it would help you win!! Pick a square if you would lose by not picking it! Pick the middle square Pick a corner square (any one?) Pick a center-edge square (any one?) 2. Quit if no square is available

A program Repeat the following steps forever 1. If it is not taken Pick a square if it would help you win!! Pick a square if you would lose by not picking it! Pick the middle square Pick a corner square (any one?) Pick a center-edge square (any one?) 2. Draw a Circle; color it green; … 3. Quit if no square is available

Generalization Questions Can you write a program for a 4 by 4 tic-tac-toe board? 5 by 5? n by n? 3-dimensional tic-tac-toe? k-dimensional tic-tac-toe? m by n, when m is not equal to n? What does it mean to win? What if some squares are blocked, i.e., no one can move there?

Even More Questions Can the first player always win 3 by 3 tic-tac-toe? 2 by 2 tic-tac-toe? 3 by 3 by 3? …

Toy problems to real ones Chess Deep Blue vs. Kasparov Map quest No adversary, but you’re trying to reach a goal through a bunch of moves; Closed roads are like blocked squares Wall street investment Airline reservations Computer is not intelligent; but the instructions better be!

Basic questions about strategies Is our strategy efficient? Is it correct, i.e., can we guarantee the strategy will always work?

More Problem Solving Ask your friend to guess a mystery number between 1 and 10 You can ask your friend only yes or no questions Figure out a strategy to find out the number

More Problem Solving How many questions did you have to ask to unearth the mystery? What is the best case? What is the worst case?

Approach 1: Random Pick a new number at random and ask if it is the mystery number

Approach 2: Linear Start from number 1 and ask if it is the mystery number

Approach 3: Novel? Is the number odd? If yes, is it divisible by 3? If yes, is it 3? Done. If not, is it prime? If yes, is it 5? Done. If not, Done If not, is it divisible by 4? If yes, is it 4? Done. If yes, done. If not, is it 6? Done.

Approach 4: Binary Search Is the number greater than 5? If yes, is it greater than 8? If yes, is it greater than 9? Done. If not, is it greater than 7? If yes, done. If not, is it greater than 6? Done. If not, is it greater than 3? If yes …

Analysis of the Approaches Approach 1 (random) vs 2 (linear) Best case 1 worst case 10 Random approach is more entertaining, but needs to store previous guesses Approach 3 (novel) vs 4 (binary) Best case 3 worst case 4 Novel approach is more entertaining, but requires more bookkeeping

Linear and Binary Searches Suppose it takes 1 millisecond to ask a question and get an answer To guess a number between 1 and 10,000,000 Linear search requires about 3 days Binary search requires about 24 milliseconds Google would be really slow if it depended totally on linear search!

Software Correctness First, we specify what problem needs to be solved Then we develop an efficient strategy for solving it and code it We can run code on some examples and see if it works (testing) Without ever running the code, we can prove that code is correct using mathematical logic! Software is unique in this way. Can’t do this for physical devices; they have wear and tear!

Example Problem Specification Find the nearest, but smaller “whole number” square root of a given positive number For 25, the answer I want is 5 For 28, the answer I want is also 5 Can you specify what I want? Suppose x is the number I give you. Suppose y is the answer. What is the relationship between x and y?

Problem Specification: Goal Can you specify what I want? Suppose x is a positive number I give you. Suppose y is the answer. What is the relationship between x and y? Goal: Find y such that (y * y) ≤ x ≤ (y + 1) * (y + 1)

Linear Search Suppose x = 10,050. What is y? Try y = 1. Try y = 2. … Try y = 99. Try y = 100. Success!

Binary search Suppose x = 10, 050. What is y? Try y = 1. Try y = 2. … Try y = 64. Try y = 128. Too big. Try y = (64 + 128)/2 = 96. Too small. Try y = (128 + 96)/2 = 112. Too big. Try y = (96 + 112)/2 = 104. Too big. Try (104 + 96)/2 = 100. Just right!

Is the binary search approach correct? Will it always terminate? Will it always produce y that satisfies the goal? (y * y) ≤ x ≤ (y + 1) * (y + 1) We can prove both these claims using mathematical logic, automatically!

RESOLVE Research at Clemson

Logical proofs because…

Logical proofs because…

Logical proofs because…

Logical proofs because…

Notable Software Disasters Mariner bugs out (1962, $18.5 M) Hartford Coliseum Collapse($90M, ‘78) CIA gives Soviets the gas (priceless, ‘82) World War III…Almost (‘83) Medical Machine Kills (‘85) … Medical Machine Kills (2009) 20 Famous Software Disasters http://www.devtopics.com/20-famous-software-disasters/

Frontiers… What problems can be solved with software? What problems are tractable? For the problems that are tractable, are the present solutions the best we can get? How do we design programs so that they can be proved correct? … Would software help you remotely “drive” your kids to school some day?