1 / 10

Game Tree Evaluation

Game Tree Evaluation. 4 th Feb. 2008 Scribe: Lekhendro Lisham. Game Tree. 0. V. 1 0. V. V. 2k levels. No. of leaves, n = 2 2k = 4 k. 0 1 0 0. V. V. V. V.

harsha
Download Presentation

Game Tree Evaluation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Game Tree Evaluation 4th Feb. 2008 Scribe: Lekhendro Lisham

  2. Game Tree 0 V 1 0 V V 2k levels No. of leaves, n = 22k = 4k 0 1 0 0 V V V V 0 1 1 1 0 1 1 0 Figure: A game tree with 2k levels A deterministic algorithm to determine the number of leaves of a game tree of height 2k will be in the order of O(n).

  3. Examples V V Expected no. of steps = (1+ 2)/2 0 1 0 1 Expected no. of steps = (1 + 2 )/2 V V Expected no. of steps = 2 1 1 0 0 Expected no. of steps = 2

  4. Deterministic algorithm of Λnode in the game tree: { if (Leftchild == 0) then o/p is 0; else { if (Rightchild == 0) then o/p is 0; else o/p is 1; } } V 0 1

  5. Probabilistic algorithm ofΛnode in the game tree: { randomly pick child Є {left, right} if (child == 0) then o/p is 0; else { if (otherChild == 0) then o/p is 0; else o/p is 1; } } V 0 1 This probabilistic algorithm is an example of Las Vegas algorithm.

  6. The generic algorithm for anygame tree: ComputeBitAtRoot(T) // T is the root of the game tree. { If T is ‘Λ’ then { Select c Є {T.left, T.right} cBit = ComputeBitAtRoot(c) if (cBit==0) then return 0; else { otherBit = ComputeBitAtRoot(otherchild); if (otherBit ==0) then return 0; else return 1; } } If T is ‘V’ then { Select c Є {T.left, T.right} cBit = ComputeBitAtRoot(c) if (cBit==1) then return 1; else { otherBit = ComputeBitAtRoot(otherchild); if (otherBit ==1) then return 1; else return 0; } } } V T V V left right V V V V

  7. Theorem: The expected number of leaves checked is <= 3k. • Proof by induction: Assume that the statement is true for k-1 or less. Assume 1 was returned at X1. Then, V Y X2 V V X1 2k V V V V 2k-1 • Thus, the expected number of leaves for the above case is: • <= 3 k-1 X 0.5 + 0.5 X 2 X 3 k-1 • = (3/2) X 3 k-1.

  8. Contd… • Assuming 0 was returned at X1, then, Expected number of leaves for this case is 2 X 3 k-1 .

  9. Contd… • Evaluation of Y • Assume Y evaluates to 0 Expected number of leaves for this case is, <= 0.5 X 2 X 3 k-1 + 0.5 X (7/2) X 3 k-1 = (11/4) X 3 k-1 <= (12 /4) X 3 k-1 = 3 k.

  10. Contd… • Evaluation of Y • Assume Y evaluates to 1 Expected number of leaves for this case is 3 k.

More Related