How to create two functions that the player may use to implement their strategy. Create a ___function___
Question:
How to create two functions that the player may use to implement their strategy. Create a ___function___ called `lookup_action` with two ___arguments___ `hand` and `dealer_card`. The ___function___ `lookup_action` should ___return___ whether the player should "Hit" or "Stand" using the ___data frame___ `df_action_lookup`. Create another ___function___ called `lookup_action_alt` with the same arguments as `lookup_action`. The ___function___ `lookup_action_alt` should ___return___ whether the player should "Hit" or "Stand" using the ___data frame___ `df_action_lookup_alt`.
Additional information: We can implement a lookup table in R using a ___data frame___. The ___data frame___ will be used to determine if the player should perform the action `hit` or `stand` based on: 1. _hand_value_: The sum of the cards in the player hand i.e. column hand_value 2. _useable_ace_: Whether the hand of the player contains a useable ace, an ace than can count as 11 without the player going `bust` (column: usable_ace) 3. _dealer_ace_ to _dealer_ten_: the face-up card of the dealer Two lookup tables have been created, `df_action_lookup` and `df_action_lookup_alt`. `df_action_lookup` is the player's default strategy, while `df_action_lookup_alt` serves as the alternative strategy.
Quantitative Methods for Business
ISBN: 978-0324651751
11th Edition
Authors: David Anderson, Dennis Sweeney, Thomas Williams, Jeffrey cam