CSE 203A: Randomized Algorithms

Similar documents
6.856 Randomized Algorithms

Trees (Part 1, Theoretical) CSE 2320 Algorithms and Data Structures University of Texas at Arlington

Artificial Intelligence. Game trees. Two-player zero-sum game. Goals for the lecture. Blai Bonet

CPSC 436D Video Game Programming

CAP 5993/CAP 4993 Game Theory. Instructor: Sam Ganzfried

Module 4: Index Structures Lecture 13: Index structure. The Lecture Contains: Index structure. Binary search tree (BST) B-tree. B+-tree.

CS 3410 Ch 7 Recursion

Backtracking and Branch-and-Bound

Multiple Agents. Why can t we all just get along? (Rodney King) CS 3793/5233 Artificial Intelligence Multiple Agents 1

(Provisional) Lecture 32: Estimated Value, Minimax, Functional Data 10:00 AM, Nov 20, 2017

Trees. Eric McCreath

Trees. CSE 373 Data Structures

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Algorithms and Game Theory Date: 12/3/15

COMP Analysis of Algorithms & Data Structures

Outline. Computer Science 331. Insertion: An Example. A Recursive Insertion Algorithm. Binary Search Trees Insertion and Deletion.

COMP Analysis of Algorithms & Data Structures

Multi-Way Search Tree

Parallel Computation: Many computations at once, we measure parallel time and amount of hardware. (time measure, hardware measure)

Search and Optimization

Uses for Trees About Trees Binary Trees. Trees. Seth Long. January 31, 2010

Algorithm Design Techniques (III)

Data Structures and Algorithms

Trees, Trees and More Trees

Monotonicity. Admissible Search: That finds the shortest path to the Goal. Monotonicity: local admissibility is called MONOTONICITY

Data Structures in Java

Here is a recursive algorithm that solves this problem, given a pointer to the root of T : MaxWtSubtree [r]

Lecture 1: An Introduction to Online Algorithms

Comparison Based Sorting Algorithms. Algorithms and Data Structures: Lower Bounds for Sorting. Comparison Based Sorting Algorithms

Lower Bound on Comparison-based Sorting

March 20/2003 Jayakanth Srinivasan,

3.6.2 Generating admissible heuristics from relaxed problems

Algorithms and Data Structures: Lower Bounds for Sorting. ADS: lect 7 slide 1

B+ Tree Review. CSE332: Data Abstractions Lecture 10: More B Trees; Hashing. Can do a little better with insert. Adoption for insert

II (Sorting and) Order Statistics

(2,4) Trees. 2/22/2006 (2,4) Trees 1

Balanced Search Trees. CS 3110 Fall 2010

CS 231: Algorithmic Problem Solving

CHAPTER 11 Trees. 294 Chapter 11 Trees. f) This is a tree since it is connected and has no simple circuits.

Point Enclosure and the Interval Tree

Topics. Trees Vojislav Kecman. Which graphs are trees? Terminology. Terminology Trees as Models Some Tree Theorems Applications of Trees CMSC 302

Games and Adversarial Search II Alpha-Beta Pruning (AIMA 5.3)

Binary Trees, Binary Search Trees

Algorithm Theory, Winter Term 2015/16 Problem Set 5 - Sample Solution

Advanced Algorithm Design and Analysis (Lecture 12) SW5 fall 2005 Simonas Šaltenis E1-215b

(2,4) Trees Goodrich, Tamassia (2,4) Trees 1

Lecture 9. Heuristic search, continued. CS-424 Gregory Dudek

Parallel and Sequential Data Structures and Algorithms Lecture (Spring 2012) Lecture 16 Treaps; Augmented BSTs

CSCI-401 Examlet #5. Name: Class: Date: True/False Indicate whether the sentence or statement is true or false.

Algorithms Dr. Haim Levkowitz

Scan Primitives for GPU Computing

INF2220: algorithms and data structures Series 1

The Simplex Algorithm for LP, and an Open Problem

Uninformed Search Methods. Informed Search Methods. Midterm Exam 3/13/18. Thursday, March 15, 7:30 9:30 p.m. room 125 Ag Hall

Algorithms and Data Structures (INF1) Lecture 8/15 Hua Lu

Exercise 1 : B-Trees [ =17pts]

Some Search Structures. Balanced Search Trees. Binary Search Trees. A Binary Search Tree. Review Binary Search Trees

Multiway Search Trees. Multiway-Search Trees (cont d)

Data Structure Lecture#10: Binary Trees (Chapter 5) U Kang Seoul National University

Data Structures and Algorithms Week 4

Algorithms. AVL Tree

Solutions. (a) Claim: A d-ary tree of height h has at most 1 + d +...

Data Structures and Algorithms Chapter 4

Spatial Data Structures

1 The range query problem

CS 231 Data Structures and Algorithms Fall Recursion and Binary Trees Lecture 21 October 24, Prof. Zadia Codabux

Spatial Data Structures

Algorithm Design Techniques. Hwansoo Han

Treaps. 1 Binary Search Trees (BSTs) CSE341T/CSE549T 11/05/2014. Lecture 19

Question 7.11 Show how heapsort processes the input:

Lecture outline. Decision-tree classification

Data Structures. Sorting. Haim Kaplan & Uri Zwick December 2013

Midterm solutions. n f 3 (n) = 3

CS24 Week 8 Lecture 1

kd-trees Idea: Each level of the tree compares against 1 dimension. Let s us have only two children at each node (instead of 2 d )

1 Leaffix Scan, Rootfix Scan, Tree Size, and Depth

B-trees and Pólya urns

12/5/17. trees. CS 220: Discrete Structures and their Applications. Trees Chapter 11 in zybooks. rooted trees. rooted trees

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Sorting lower bound and Linear-time sorting Date: 9/19/17

1 Introduction to Game Theory

CSE 214 Computer Science II Introduction to Tree

Search Trees - 1 Venkatanatha Sarma Y

The best sorting algorithm that sorts by comparing the elements with each other is order Nlog(N). Why?

CSE 3101: Introduction to the Design and Analysis of Algorithms. Office hours: Wed 4-6 pm (CSEB 3043), or by appointment.

Section 4 SOLUTION: AVL Trees & B-Trees

CSE 613: Parallel Programming. Lecture 11 ( Graph Algorithms: Connected Components )

Data Structures and Algorithms

CS521 \ Notes for the Final Exam

Self-Balancing Search Trees. Chapter 11

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 10 Notes. Class URL:

Randomized Algorithms: Selection

Programming Languages and Techniques (CIS120)

Greedy Algorithms. Alexandra Stefan

APHID: Asynchronous Parallel Game-Tree Search

Chapter-6 Backtracking

Lecture 14: Lower Bounds for Tree Resolution

CSE 530A. B+ Trees. Washington University Fall 2013

Binary Heaps in Dynamic Arrays

CSE 417 Dynamic Programming (pt 6) Parsing Algorithms

Machine Learning (CSE 446): Concepts & the i.i.d. Supervised Learning Paradigm

Strategies to Fast Evaluation of Tree Networks

Transcription:

CSE 203A: Randomized Algorithms (00:30) The Minimax Principle (Ch 2) Lecture on 10/18/2017 by Daniel Kane Notes by Peter Greer-Berezovsky Game Tree Evaluation (2.1) - n round deterministic 2-player game - Players take turns making a 1-bit choice - At end winner is some function of choices made We can represent all the possible states and outcomes of such a game with a Game Tree. Where each node represents a game state(root = start, leaves = end) and contains a value 0 or 1 to represent that there exists a winning strategy for the first or second player, where if they make the correct choice every time they will always be able to reach some leaf node-end state where they win. Given the leaf nodes of any game tree it is possible to solve for every node up to the root node recursively, by looking at which player would have the ability to choose at each level. There s always a winning strategy for one of the two players at every state. This can be shown inductively using a tree with 1 root node and 2 leaf nodes as a base case and then by doing the following.

Given a game tree of height n whose two subtrees of height n-1 both have winning strategies for one of the two players. If either subtree has a winning strategy for the first player The first player will choose to go down a winning subtree and have a winning strategy. Else The second player has a winning strategy regardless of the first player's decision. Label node 1 if player whose turn it is has winning strategy. Label node 0 otherwise. Label (node) = NAND (labels(children)) (07:45) NAND-Tree Evaluation Height n binary tree with labels at leaves. This tree can be thought of as a circuit with NANDs at the non-leaf nodes for the purpose of evaluating the output of the root. Query Complexity Algorithm queries for values at leaves. Cost (algorithm) = # queries. (12:25) Deterministic Algorithms Requires 2 n = 4 n/2 queries on leaf nodes. When evaluating a node's first child keep the node value as 1 to signify that we don t yet know what the outcome is for the NAND node. This makes the algorithm correctly evaluate both children recursively. Inductively we force the algorithm to evaluate every single leaf. 2 n-1 for each child. (15:00) NP Algorithms Have hints(someone telling you the winning strategy, but not the adversaries choices) about which leaves to query, but need to prove the answer Only 2 n/2 queries needed to evaluate part of game tree that comes from the winning strategy for the first player, because their first decision will immediately cut out the other 2 n/2 leaf nodes from possibility. (17:30) Randomized Algorithm

Pick a random child of root and recursively evaluate If child evaluates to 0 Done, return there is a winning strategy Else Evaluate other child and return based on that. = E[queries for tree of height n, in which root is winning] L n = E[queries for tree of height n, in which root is losing] = 2 W n-1 <= L n-1 + (1/2)W n-1 L n = 2W n-1 <= 2L n-2 + W n-2 <= L n-1 + (1/2)W n-1 <= 2W n-2 + (1/2)L n-2 + (1/4)W n-2 Something n <= 3Something n-2 Therefore, E[queries] <=3 n/2 (26:00) Lower Bounds Game between Algorithm - Trying to figure out answer with as few queries as possible. Input A - Wants to force Algorithm to need as many queries as possible. For deterministic algorithm, adversary just abuses mechanics of algorithm to maximize queries with a designed bad input. Randomness helps here because instead of needing just 1 bad input, the adversary now needs inputs that are bad on average for the randomization. ROCK PAPER SCISSORS - Matrix Games Rock Paper Scissors Rock 0-1 1 Paper 1 0-1 Scissors -1 1 0

A zero sum game, both players have diametrically opposed goals. One player can only win by beating the other. Deterministic strategies are bad, because there is always an input that completely beats it. Randomized algorithms can be used to always guarantee you a chance of success A randomized algorithm is simply a probability distribution over which deterministic algorithm to play.(rock, paper, scissors) Assuming adversary can t know your randomness they can no longer reliably beat you. (36:20) Matrix M Randomized algorithm probability vector P P tells us probability of playing each rock, paper or scissors. Payoff against input i = p M e Σ i M i j = p T j (37:35) Minimax Strategy - Finding best worst case outcome Sup = supremum Inf = Infimum up in M e up nf M S p M j p T j = S p I q p T q Algorithm picks strategy p, Adversary picks strategy q. Goal of algorithm is to pick a p such that the best possible q would be as good for the algorithm as possible. (40:00) Thrm Von Neumann (2.2) p and q are probability vectors. Supp Inf q p T M q = Inf q Sup p p T T M q = Inf q M ax e i e i M q Moral: We can prove optimal lower bounds by finding an input distribution such that ANY deterministic algorithm has bad average case analysis. To prove lower bounds don t find bad inputs, find bad input distributions. (46:00)

NAND Tree Evaluation Pick P = (sqrt(5) - 1) / 2. Each leaf independently equals 1 with probability P. P 2 = 1 - p implies all nodes in the tree are 1 with probability p Prop 2.7 If leaves are iid independent, then the best deterministic algorithm is a depth first pruning algorithm. W(n) = W(n-1) + P*W(n-1) = (1 + P) n = (1.616...) n which is the golden ratio Random solution evaluates out to (1.41...) n, so by using the random algorithm we can on average beat out the deterministic algorithm.