Assignment 2 Observations

Slides:



Advertisements
Similar presentations
By: Jonathan Quenzer. To have a computer learn how to play Blackjack through reinforcement learning Computer starts off with no memory. After each hand.
Advertisements

© Glenn Rowe AC Lab 2 A simple card game (twenty- one)
Complexity Classes: P and NP
NP-Hard Nattee Niparnan.
Todd W. Neller Gettysburg College
Markov Decision Process
Max Cut Problem Daniel Natapov.
Techniques for Dealing with Hard Problems Backtrack: –Systematically enumerates all potential solutions by continually trying to extend a partial solution.
Class Project Due at end of finals week Essentially anything you want, so long as it’s AI related and I approve Any programming language you want In pairs.
CSE 5522: Survey of Artificial Intelligence II: Advanced Techniques Instructor: Alan Ritter TA: Fan Yang.
Lecture 10. Simplified roulette European roulette has numbers 0,1,…36. xD0s
BLACKJACK SHARKS: Aabida Mayet, Omar Bacerra, Eser Kaptan March 15, 2010.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 15 Chances, Probabilities, and Odds 15.1Random Experiments and.
Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.
Computer Science 313 – Advanced Programming Topics.
Fast FAST By Noga Alon, Daniel Lokshtanov And Saket Saurabh Presentation by Gil Einziger.
Planning under Uncertainty
CPSC 322, Lecture 37Slide 1 Finish Markov Decision Processes Last Class Computer Science cpsc322, Lecture 37 (Textbook Chpt 9.5) April, 8, 2009.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
CS21 Decidability and Tractability
Computational Complexity CSC 172 SPRING 2002 LECTURE 27.
Slides prepared by Rose Williams, Binghamton University Chapter 3 Flow of Control Loops in Java.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
1 Java Grande Introduction  Grande Application: a GA is any application, scientific or industrial, that requires a large number of computing resources(CPUs,
CS 188: Artificial Intelligence Spring 2007 Lecture 14: Bayes Nets III 3/1/2007 Srini Narayanan – ICSI and UC Berkeley.
Applied Discrete Mathematics Week 12: Trees
CIS101 Introduction to Computing Week 12 Spring 2004.
Please open your laptops, log in to the MyMathLab course web site, and open Daily Quiz 18. You will have 10 minutes for today’s quiz. The second problem.
Black Jack Dr. Bernard Chen University of Central Arkansas Spring 2012.
CS Reinforcement Learning1 Reinforcement Learning Variation on Supervised Learning Exact target outputs are not given Some variation of reward is.
Chapter 3 – Linear Systems
Key Stone Problem… Key Stone Problem… next Set 22 © 2007 Herbert I. Gross.
Fixed Parameter Complexity Algorithms and Networks.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Table of Contents Solving Linear Systems of Equations - Dependent Systems The goal in solving a linear system of equations is to find the values of the.
Mark Dunlop, Computer and Information Sciences, Strathclyde University 1 Algorithms & Complexity 5 Games Mark D Dunlop.
Math Games Compiled By: Joan Bartlett and Heather Bartlett.
Semester Review. As we have discussed, Friday we will have in class time for you to work on a program, this program will come with instructions and you.
Conditions. Objectives  Understanding what altering the flow of control does on programs and being able to apply thee to design code  Look at why indentation.
Efficient Solution Algorithms for Factored MDPs by Carlos Guestrin, Daphne Koller, Ronald Parr, Shobha Venkataraman Presented by Arkady Epshteyn.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
Module 1 ~ Topic 2 Solving Inequalities Table of Contents  Slides 3-4: Introduction to Inequalities  Slides 5-6: Notation and Properties  Slide 7: Multiplying/Dividing.
CS 4730 Probability and Risk CS 4730 – Computer Game Design Credit: Several slides from Walker White (Cornell)
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
Homework due Test the random number generator Create a 1D array of n ints Fill the array with random numbers between 0 and 100 Compute and report the average.
ITEC 109 Lecture 11 While loops. while loops Review Choices –1 st –2 nd to ?th –Last What happens if you only use ifs? Can you have just an else by itself?
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
Exact Inference in Bayes Nets. Notation U: set of nodes in a graph X i : random variable associated with node i π i : parents of node i Joint probability:
Lecture Coursework 2 AGAIN. Rectangle Game Look at proof of matchsticks A rectangular board is divided into m columns by n rows. The area of the board.
Easy, Hard, and Impossible Elaine Rich. Easy Tic Tac Toe.
Announcements Finish up Network Flow today Then Review for Final on Monday ◦ HW#5 is due on Monday, let me or the TA’s know if you have trouble starting.
Instructor: Shengyu Zhang 1. Optimization Very often we need to solve an optimization problem.  Maximize the utility/payoff/gain/…  Minimize the cost/penalty/loss/…
The Law of Averages. What does the law of average say? We know that, from the definition of probability, in the long run the frequency of some event will.
Final Exam Information These slides and more detailed information will be posted on the webpage later…
CSC 212 – Data Structures Lecture 28: More Hash and Dictionaries.
CSC 172 P, NP, Etc.
Inference in Bayesian Networks
Lecture 10.
Announcements Homework 3 due today (grace period through Friday)
Probability Topics Random Variables Joint and Marginal Distributions
Solving Systems of equations
Review
Truth tables: Ways to organize results of Boolean expressions.
Blackjack: Counting Hands and Counting Cards
SSEA Computer Science: Track A
Solving Systems of equations
Presentation transcript:

Assignment 2 Observations Mausam © Mausam

The SAT Encoding Induced Subgraph Isomorphism Variables NP complete problem Applications: similarities between chemical compounds; protein-interaction networks, social networks, circuit design.. Variables X(i,j) denotes that ith node (in smaller graph) mapped to jth node (in larger graph) Self edge: If node i has a self-edge and node j doesn’t remove X(i,j) Self-edge: If node j has a self-edge and node i doesn’t © Mausam

The SAT encoding Overall – O(nm) vars, O(n2m2) clauses Each node maps to exactly one other node X(i,1)  X(i,2)  X(i,3)…  X(i,n) Pairs of  X(i,1)   X(i,2);  X(i,1)   X(i,3) … Each node in larger graph maps to at most one node Pairs of X(1,j)X(2,j); X(1,j)X(3,j); … Disallowed pairs of mappings If edge(i1,i2) and no edge(j1,j2): X(i1,j1)X(i2,j2); If no edge(i1,i2) and edge(j1,j2): X(i1,j1)X(i2,j2); If edge(i1,i2) and edge(j2,j1): X(i1,j1)X(i2,j2); Overall – O(nm) vars, O(n2m2) clauses © Mausam

Fun optimizations Degree trick: Can B ever map to P/S/R? Yes. A mapping is: M(A) = S, M(B) = Q, M(C) = R The edges from P to other nodes don‘t matter since no node in G got mapped to P. Degree trick: Can B ever map to P/S/R? No: Indegree of B is greater than indegree of P/S/R Remove X(B,P), X(B,S), X(B,R) Common neighbor constraint: Can A-U and C-T? They both don’t have an edge They both have outdegrees 1 No: because AC have common neighbor 1; UT 0 X(A,U)X(C,T) … A C P R T B Q © Mausam

Observations People solved ~100+80 node problems… For an NP hard problem that’s not too bad, is it? Paresh’s observations adding redundant clauses helps miniSAT for tough problems. © Mausam

Best Competitors Kim Wallmark Alan Ludwig Haroon Barri © Mausam

Assignment 3 Discussion Mausam © Mausam

BlackJack: State Space MinSum: the minimum sum of the player's hand so far. NumAces: the number of Aces in the player's hand so far. dMinSum: the minimum sum of the dealer's hand so far. dNumAces: the number of Aces in the dealer's hand so far. isTwoCards: a Boolean that represents that the player's hand has just two cards so far. isBlackJack: a Boolean that represents that the player got a BlackJack. pair: has value between 0 and 10. Zero indicates that the player doesn't have a pair. Any other value i indicates that the player has two cards of value i. turn: a Boolean to indicate whether it is player's turn or dealer's. © Mausam

BlackJack: Action Space Stand: Turn = 0 Hit: get a new card with prob… update minSum, numAces, isTwoCard, pair Double: get a new card, update minSum, numAces, etc.; Turn = 1. Allowed when isTwoCard = 1 Default: run default dealer policy. Allowed with turn = 1 Split: tricky! Allowed with pair > 0; isTwoCard = 1 © Mausam

Equations © Mausam

BlackJack Split (say only three cards) Q((c,c), SPLIT) 2p1p1V(c,1) p1p2V(c,1) + p1p2V(c,2) p1p3V(c,1) + p1p3V(c,3) p2p1V(c,1) + p2p1V(c,2) 2p2p2V(c,2) p2p3V(c,3) + p2p3V(c,3) 2p3p3V(c,3) (c,c) [(c,1) & (c,1)] p1p1 [(c,1) & (c,2)] p1p2 [(c,1) & (c,3)] p1p3 [(c,2) & (c,1)] p2p1 [(c,2) & (c,2)] p2p2 [(c,2) & (c,3)] p2p3 [(c,3) & (c,1)] p3p1 [(c,3) & (c,2)] p3p2 [(c,3) & (c,3)] p3p3 2p1(p1+p2+p3) = 2p1 © Mausam

Equations © Mausam

Value of Terminal States If isTwoCards = 1, minSum=11, numAces = 1 Return 1.5 If minSum>21 Return -1 If minSum < 21 and dMinSum > 21 Return 1 … © Mausam

Can you solve it with Expectimax? No Because there is possibility of infinite loop Values are well-formed Loop of size n becomes less probable as n increases (see beginning example from lecture on MDPs) EXCEPTION: Q(1010, split) for p> 0.5 Solution: use Value Iteration/Policy Iteration © Mausam

Optimizations Dealer’s policy is fixed. So, run the Markov chain ahead of time to generate a table Pr(dealer gets 17|first card=c) Pr(dealer gets 18|first card=c) Pr(dealer gets 19|first card=c) Pr(dealer gets 20|first card=c) Pr(dealer gets 21|first card=c) Pr(dealer busts|first card=c) Remove dMinSum, dNumAces, turn. Add dFirstCard Remove Default action Change the equations for double/stand based on computed probabilities © Mausam

Comments numAces – not required. Convert to hasAce Only first ace is relevant. After that each ace = 1 Handle infinite splits by allowing say, 10 splits Should work fine in practice Modification: have the bet amount in state space Needn’t multiply by 2 in equations for doubling Need to use this info when computing terminal rewards © Mausam

Difference in solutions? In real BJ: Dealer and player BJ is a push In our BJ: player wins ??? In real BJ: there is a 4/6/8 card deck In our BJ: infinite cards You can easily modify code to handle 1st case 2nd case: Monte carlo sampling! © Mausam

Should you play our BlackJack? Expected reward before game starts SUM[Pr(game)*expected reward of the game] Deal three cards… and use V(s) to compute exp reward My expected reward: $0.058 Yes! We should play the game © Mausam

Discussion Mausam © Mausam

Followup Courses 546 Machine Learning/Data Mining 515 Probabilistic Graphical Models 517 Natural Language Processing ??? AI/Statistics for Big Data 571 Robotics 579 Intelligent control 574 Special Topics in AI 528 Computational Neuroscience 510 Human computer Interaction © Mausam

Final Exam 50% objective 25% short answer questions True/false Multiple choice Fill in the blanks Match the following… 25% short answer questions 1 word – 5 line responses… opinions/strengths/weaknesses/etc… 25% Problem solving Problem modeling; short calculations… © Mausam

Why do an exam? Goal: revise and analyze the whole course Expected preparation time ~1 day Go over lecture slides Read parts of the notes that are unclear… © Mausam

What worked Programming Assignments Written Assignments(?) Classes You hated them You loved them You learned through them Written Assignments(?) Forced us to be regular Classes I absolutely enjoyed the interaction! Emails/bulletin boards Videos(?) © Mausam

What didn’t work Programming environment Packed Workload People didn’t know unix People didn’t know Java! Packed Once someone got behind, it got tough to recover Workload © Mausam

Thanks To all of you who contributed to helping each other through newsgroup and other questions who asked terrific questions in class who gave regular feedback on class, assignments, grading, organization © Mausam