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.

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.
AI for Connect-4 (or other 2-player games) Minds and Machines.
CS 4700: Foundations of Artificial Intelligence Bart Selman Reinforcement Learning R&N – Chapter 21 Note: in the next two parts of RL, some of the figure/section.
Tutorial 6 of CSCI2110 Bipartite Matching Tutor: Zhou Hong ( 周宏 )
How many squares are there on a chess board?
CS420 lecture one Problems, algorithms, decidability, tractability.
Representing a Game Board In a game, we represent the action taking place using an array – In a very simple game, we use individual variables to represent.
Intro to Robots 10 Artificial Intelligence “I want to make a computer that will be proud of me” Daniel Hillis.
Analysis of Algorithms CS 477/677
Lecture 20: April 12 Introduction to Randomized Algorithms and the Probabilistic Method.
Games, Hats, and Codes Mira Bernstein Wellesley College SUMS 2005.
What are some of the ways you that that we can categorise numbers?
Anna Rybak, University of Bialystok, Poland István Lénárt, ELTE University, Hungary Play computer game... and learn spherical geometry.
COMPSCI 102 Introduction to Discrete Mathematics.
Searching and Sorting Topics Sequential Search on an Unordered File
CHAPTER 09 Compiled by: Dr. Mohammad Omar Alhawarat Sorting & Searching.
Week 5 - Monday.  What did we talk about last time?  Linked list implementations  Stacks  Queues.
Algorithms and their Applications CS2004 ( ) Dr Stephen Swift 1.2 Introduction to Algorithms.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
Mark Dunlop, Computer and Information Sciences, Strathclyde University 1 Algorithms & Complexity 5 Games Mark D Dunlop.
Patterns and Reuse. Patterns Reuse of Analysis and Design.
1 Wright State University, College of Engineering Dr. T. Doom, Computer Science & Engineering CS 241 Computer Programming II CS 241 – Computer Programming.
Art 321 Lecture 7 Dr. J. Parker. Programming In order to ‘make things happen’ on a computer, you really have to program it. Programming is not hard and.
Game Playing. Towards Intelligence? Many researchers attacked “intelligent behavior” by looking to strategy games involving deep thought. Many researchers.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
Making Decisions uCode: October Review What are the differences between: o BlueJ o Java Computer objects represent some thing or idea in the real.
Big Oh CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University of Wisconsin.
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
Hexahexaflexagon Automata Paul Curzon Queen Mary University of London With support from Google,
CSE373: Data Structures & Algorithms Lecture 22: The P vs. NP question, NP-Completeness Lauren Milne Summer 2015.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
Clustering Prof. Ramin Zabih
Inequalities and their Graphs Objective: To write and graph simple inequalities with one variable.
Explorers need maps: Abstraction, representations and graphs Paul Curzon Queen Mary University of London
Today’s Topics Playing Deterministic (no Dice, etc) Games –Mini-max –  -  pruning –ML and games? 1997: Computer Chess Player (IBM’s Deep Blue) Beat Human.
WHAT IS COMPUTER SCIENCE? Phil Sands K-12 Outreach Coordinator for Computer Science.
Helping Our Children To Achieve Welcome Maths is FUN!
SNU OOPSLA Lab. 1 Great Ideas of CS with Java Part 1 WWW & Computer programming in the language Java Ch 1: The World Wide Web Ch 2: Watch out: Here comes.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
CS 1110/1111 The Case for Computer Science CS 1110/1111 – Introduction to Programming.
Multiplication of Common Fractions © Math As A Second Language All Rights Reserved next #6 Taking the Fear out of Math 1 3 ×1 3 Applying.
Year 9 Proof Dr J Frost Last modified: 19 th February 2015 Objectives: Understand what is meant by a proof, and examples.
CS 150: Analysis of Algorithms. Goals for this Unit Begin a focus on data structures and algorithms Understand the nature of the performance of algorithms.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
In the news: A recently security study suggests that a computer worm that ran rampant several years ago is still running on many machines, including 50%
Inequalities and their Graphs Objective: To write and graph simple inequalities with one variable.
1 Computability Tractable, Intractable and Non-computable functions.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 23: Intractable Problems (Smiley Puzzles.
Algorithm Analysis with Big Oh ©Rick Mercer. Two Searching Algorithms  Objectives  Analyze the efficiency of algorithms  Analyze two classic algorithms.
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.
CST 1101 Problem Solving Using Computers
Introduction: Computer programming
Intro to Computer Science CS1510 Dr. Sarah Diesburg
David Kauchak CS52 – Spring 2016
Foundations of Computer Science
ASU 101: The ASU Experience Computer Science Perspective
Mastery Unlocked Session 4: Fluency.
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Topic 1: Problem Solving
DW Daniel High, SC; Jan 25, 2010 Murali Sitaraman
CS 416 Artificial Intelligence
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Breakfast Bytes Easy, Hard, and Impossible
Discrete Mathematics in the Real World
Interesting Algorithms for Real World Problems
Presentation transcript:

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 25, 2010 Murali Sitaraman RESOLVE Software Research Group School of Computing, Clemson

School of Computing Clemson University Acknowledgments  Fox Filmed Entertainment  New York Times (Jan 24, 2010)  Software Development Topics, Timm Martin  1001Crash.com  US National Science Foundation

School of Computing Clemson University Computer Science is fun

School of Computing Clemson University Computer Science is everywhere

School of Computing Clemson University Computer Science is everywhere

School of Computing Clemson University Computer Science is everywhere

School of Computing Clemson University CS is serious business  Link Link

School of Computing Clemson University CS is serious business

School of Computing Clemson University CS is serious business

School of Computing Clemson University CS has applications everywhere  Arts  Math  Medicine  Physical Sciences  Engineering  Finances and management  …  So your job prospects are excellent with a CS degree, but this talk is not about that

School of Computing Clemson University 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

School of Computing Clemson University Let’s play

School of Computing Clemson University Let’s play tic-tac-toe  Play with your friend a few times  Figure out a strategy…  Can you always win?  Do you always lose?

School of Computing Clemson University

Do the colors matter?

School of Computing Clemson University Do the shapes matter?

School of Computing Clemson University What matters?

School of Computing Clemson University 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!

School of Computing Clemson University Strategies for solving tic-tac-toe 1. Pick the middle square, if it is not taken 2. ??? 3. ???

School of Computing Clemson University Strategies for solving tic-tac-toe If it is not taken 1. Pick the middle square 2. Pick a square if it would stop the other person from winning 3. ???

School of Computing Clemson University Strategies for solving tic-tac-toe If it is not taken 1. Pick the middle square 2. Pick a square if you would lose by not picking it! 3. Pick a square if it would help you win!!

School of Computing Clemson University A step-by-step procedure If it is not taken 1. Pick a square if it would help you win!! 2. Pick a square if you would lose by not picking it! 3. Pick the middle square 4. Pick a corner square (any one?) 5. Pick a center-edge square (any one?) 6. ???

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

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

School of Computing Clemson University 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?

School of Computing Clemson University 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?  …

School of Computing Clemson University 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!

School of Computing Clemson University Basic questions about strategies  Is our strategy efficient?  Is it correct, i.e., can we guarantee the strategy will always work?

School of Computing Clemson University 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

School of Computing Clemson University 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?

School of Computing Clemson University Approach 1: Random  Pick a new number at random and ask if it is the mystery number

School of Computing Clemson University Approach 2: Linear  Start from number 1 and ask if it is the mystery number

School of Computing Clemson University 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 not, is it prime? If yes, done. If not, is it 6? Done.

School of Computing Clemson University 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 …

School of Computing Clemson University 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

School of Computing Clemson University 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!

School of Computing Clemson University 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!

School of Computing Clemson University 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?

School of Computing Clemson University 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)

School of Computing Clemson University Linear Search  Suppose x = 10,050.  What is y? Try y = 1. Try y = 2. Try y = 3. Try y = 4. … Try y = 99. Try y = 100. Success!

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

School of Computing Clemson University 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!

School of Computing Clemson University RESOLVE Research at Clemson

School of Computing Clemson University Logical proofs because…

School of Computing Clemson University Logical proofs because…

School of Computing Clemson University Logical proofs because…

School of Computing Clemson University Logical proofs because…

School of Computing Clemson University 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  famous-software-disasters/ famous-software-disasters/

School of Computing Clemson University 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?