Discrete Optimization

Slides:



Advertisements
Similar presentations
SOCiable A Game of Life Chances ©Jon Witt Version 1.0.
Advertisements

© Glenn Rowe AC Lab 2 A simple card game (twenty- one)
It’s All in the Cards Adding and Subtracting Integers
Computers playing games. One-player games Puzzle: Place 8 queens on a chess board so that no two queens attack each other (i.e. on the same row, same.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 6.
Lecture 10. Simplified roulette European roulette has numbers 0,1,…36. xD0s
Dealer Comm Hand Player makes Ante bet and optional Bonus bet. Five cards are dealt to each player from the shuffler. Five cards are dealt from the shuffler.
BLACKJACK SHARKS: Aabida Mayet, Omar Bacerra, Eser Kaptan March 15, 2010.
Dice, Cards and Darts Probabilities in Games Finding the Right Representation.
Computer Science 313 – Advanced Programming Topics.
Centinel tournament ● A deck: the numbers in random order ● A game lasts until no numbers are left in deck ● A game is played like this (first player.
Pertemuan 23 : Penerapan Dinamik Programming (DP) Mata kuliah : K0164-Pemrograman vers 01.
Chapter 5 Black Jack. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 5-2 Chapter Objectives Provide a case study example from problem statement.
Test Abstractions Intent Nat. Lang. Spec. HW Behavioral Tests can be described at different abstraction levels Tests can be defined top-down or bottom-up.
Black Jack Dr. Bernard Chen University of Central Arkansas Spring 2012.
Blackjack: Myths vs. Reality Group K Andrew KerrAndrew Phillips Sven SkoogWoj Wrona.
Blackjack: An Analysis of Probability By: John Theobald.
April 2009 BEATING BLACKJACK CARD COUNTING FEASIBILITY ANALYSIS THROUGH SIMULATION.
Learning to Play Blackjack Thomas Boyett Presentation for CAP 4630 Teacher: Dr. Eggen.
Learning BlackJack with ANN (Aritificial Neural Network) Ip Kei Sam ID:
Blackjack: A Beatable Game Amber Guo Adapted from: David Parker Advisor: Dr. Wyels California Lutheran University ‘05.
MY GAME: BY JOSHUA HARDY. WHY PROBABILITY IS IN YOUR FAVOUR: P robability is in your favour because the players are limitless and the most UNCOMMON cards.
LECTURE 14: USE CASE BASICS CSC 212 – Data Structures.
Do Now 9/28/10 Take out your HW from last night. Take out your HW from last night. Textbook page 31-32, #3-11, all Textbook page 31-32, #3-11,
Homework Homework due now. Reading: relations
Quiz 4 : Minimax Minimax is a paranoid algorithm. True
HW 6: Problems 2 & 3 Simulating Connect 4. HW 6: Overview Connect 4: Variation of Tic-Tac-Toe – Board: Vertical 7x6 – Two players take alternating move.
Is One Better than None? Does foresight allow an artificial intelligence to survive longer in Tetris? William Granger and Liqun Tracy Yang.
Lecture 12. Game theory So far we discussed: roulette and blackjack Roulette: – Outcomes completely independent and random – Very little strategy (even.
Do Now 9/17/09  Take out HW from last night. Textbook page 32 #14-40 even, #48-58 even Textbook page 32 #14-40 even, #48-58 even  Copy HW in your planner.
Draw 3 cards without replacement from a standard 52 card deck. What is the probability that: 1.They are all red ? 2.At least one is black ? 3.They are.
Week 8 : User-Defined Objects (Simple Blackjack Game)
The Pentium Goes to Vegas Training a Neural Network to Play BlackJack Paul Ruvolo and Christine Spritke.
Card Game Z  Agree on a dealer and a score keeper  The dealer should remove all the Jacks, Queens, Kings & Jokers from the pack and then shuffle  The.
R. Brafman and M. Tennenholtz Presented by Daniel Rasmussen.
Discrete Optimization MA2827 Fondements de l’optimisation discrète Dynamic programming (Part 2) Material based on.
Math Parent Involvement Workshop November 11, :45 a.m. – 8:30 a.m. Second Grade.
POKER-6S ooA, OOD, OOP.
Spring ‘10 Term Project Casino Game Overview
Game Theory Just last week:
Discrete Optimization
Intro to Computer Science II
Analyzing Games of Chance Investigation 5 – How Likely Is It?
Lecture 11.
Discrete Optimization
11/7/16 Entry 173 – Objective I will review and continue developing my understanding of uniform probability models, including the complement of an event.
Chapter 5 Black Jack.
@NAMEOFEVENTORBRIDGECLUB
Lecture 10.
Probability of casino games
Lecture 12.
The Costs and Benefits of Gambling
CS330 Discussion 4 Spring 2017.
1.1.3 Analysing competitor strengths and weaknesses
Truth tables: Ways to organize results of Boolean expressions.
Kevin Mason Michael Suggs
CS 188: Artificial Intelligence Fall 2007
Truth tables: Ways to organize results of Boolean expressions.
HW 6: Problems 2 & 3 Simulating Connect 4.
Blackjack: Counting Hands and Counting Cards
September 22, 2011 Dr. Itamar Arel College of Engineering
Truth tables: Ways to organize results of Boolean expressions.
Task 2 Implementation help
HW 6: Problems 2 & 3 Simulating Connect 4.
-5*6= -6*(-8)= 2*(-16)= 54*4= Agenda Ticket in the Door
Do Now 9/24/10 Take out HW from last night. Copy HW in your planner.
BY: Cesar, Jennifer, Adrianne & Allen
Markov Decision Processes
Markov Decision Processes
Unit II Game Playing.
Presentation transcript:

Discrete Optimization MA2827 Fondements de l’optimisation discrète Dynamic programming (Part 2) https://project.inria.fr/2015ma2827/ Material based on the lectures of Erik Demaine at MIT and Pascal Van Hentenryck at Coursera

Outline Dynamic programming More dynamic programming Guitar fingering Tetris Blackjack

Quiz (as homework) Write the DP for perfect-information blackjack Derive the number of subproblems for the tetris problem

Tetris Task: win in the game of Tetris!

Tetris Task: win in the game of Tetris! Input: a sequence of n Tetris pieces and an empty board of small width w Choose orientation and position for each piece Must drop piece till it hits something Full rows do not clear Goal: survive i.e., stay within height h

Tetris Task: stay within height h Subproblem: survival? in suffix [ i : ] given a particular column profile #subproblems = O( n (h+1)w ) Guesses: where to drop piece i? #choices = O( w ) Recurrence: DP[ i, p ] = max { DP[ i + 1, q ] | q is a valid move from p } Base-case: DP[ n+1, p ] = true for all profiles p time/subproblem = O( w )

Tetris Task: stay within height h Topological order: for i = n – 1, n – 2, …, 0: for p = 0, …, (h+1)w – 1: total time O( n w (h+1)w ) Final problem: DP[ 0, empty ] pieces profiles

Blackjack Task: beat the blackjack (twenty-one)!

Blackjack Task: beat the blackjack! Rules of Blackjack (simplified): The player and the dealer are initially given 2 cards each Each card gives points: Cards 2-10 are valued at the face value of the card Face cards (King, Queen, Jack) are valued at 10 The Ace card can be valued either at 11 or 1 The goal of the player is to get more points than the dealer, but less than 21, if more than 21 than he looses (busts) Player can take any number of cards (hits) After that the dealer hits deterministically: until ≥ 17 points

Perfect-information Blackjack Task: beat the blackjack with a marked deck! Input: a deck of cards c0, …, cn-1 Player vs. dealer one-on-one Goal: maximize winning for a fixed bet $1 Might benefit from loosing to get a better deck

Perfect-information Blackjack Task: beat the blackjack with a marked deck! Subproblem: BJ( i ) = best play of ci, …, cn-1 #subproblems = O( n ) Guesses: how many times player hits? #choices ≤ n Recurrence: BJ( i ) = max{ outcome  {-1, 0, 1} + BJ( i + 4 + #hits + #dealer hits ) | for #hits = 0, …, n if valid play } Topological order: Final problem:

Perfect-information Blackjack Detailed recursion: def BJ(i): if n − i < 4: return 0 (not enough cards) outcome = [ ] for p = 2, …, n − i − 2: (# cards taken) player = ci + ci+2 + ci+4 + … + ci+p+2 if player > 21: (bust) outcome.append( -1 + BJ(i+p+2) ) break for d = 2, …, n – i – p – 1 dealer = ci+1 + ci+3 + ci+p+2 + … + ci+p+d if dealer ≥ 17: break if dealer > 21: dealer = 0 (bust) outcome.append( cmp(player, dealer) + BJ(i + p + d) ) return max( outcome )

Perfect-information Blackjack Task: beat the blackjack with a marked deck! Subproblem: BJ( i ) = best play of ci, …, cn-1 #subproblems = O( n ) Guesses: how many times player hits? #choices ≤ n Recurrence: BJ( i ) = max{ outcome  {-1, 0, 1} + BJ(i + 4 + #hits + #dealer hits ) | for #hits = 0, …, n if valid play } time/subproblem = O( n2 ) Topological order: for i = n-1, …, 0: total time O( n3 ) Final problem: BJ[ 0 ]