Mathematics
Mathematics, 30.09.2019 05:50, montecillolinda

In the casino card game blackjack, the dealer gets two cards, one of which you can see and one that is upside down. each player also gets two cards. when the dealer’s visible card is an ace, she offers you to take out “insurance”: you can bet $1 that the invisible card is a face card or a 10. if is is, you get $2, otherwise you lose your $1. let x denote your net winnings. it takes values +$1 or -$-1. what is the expected value of x if (a if we assume the dealer’s other card was chosen from a second deck of 52?

answer
Answers: 1

Similar questions

Предмет
Computers and Technology, 27.08.2019 18:00, repirce9141
Asimple blackjack card game consists of a player and a dealer (the computer). a player is dealt cards, called a hand, as is the dealer. each card in the hand has a point value. cards with a number (2-10) have the number of points associated with their face value…e.g., a 5 has a value of 5 points. picture cards (jack, queen, king) each have a value of 10 points. an ace can have a value of 1 point or 11 points at the discretion of the player. the objective of the game is to get as close to 21 points as possible without exceeding 21 points. a player that goes over is out of the game. the dealer deals cards to itself and a player. the dealer must play by slightly different rules than a player. a game proceeds as follows: a player is dealt two cards face up. if the point total is exactly 21 the player wins immediately. if the total is not 21, the dealer is dealt two cards, one face up and one face down. a player then determines whether to ask the dealer for another card (called a "hit") or to "stay" with his/her current hand. a player may ask for several "hits." when a player decides to "stay" the dealer begins to play. if the dealer has 21 it immediately wins the game. otherwise, the dealer must take "hits" until the total points in its hand is 17 or over, at which point the dealer must "stay." if the dealer goes over 21 while taking "hits" the game is over and the player wins. if the dealer’s points total exactly 21, the dealer wins immediately. when the dealer and player have finished playing their hands, the one with the highest point total is the winner. play is repeated until the player decides to quit. a deck of playing cards contains 52 cards, made up of 13 cards from 4 suits (clubs, diamonds, hearts, and spades). you may assume that there are several decks or you may use a single deck. regardless of the implementation, cards will need to be recycled if all the cards are used and there is no winner yet. the deck, or decks, should be shuffled prior to the start of a new game…and there are several ways to do that using random numbers. it is up to you to determine how an ace is valued. one approach is to provide players with a choice. another approach is to program a strategy that will be automatically implemented. there are multiple strategies that can be used…one might be to always value an ace as 11 points so long as the total points in a hand will be 21 or less. a separate strategy may be needed for the dealer. in terms of program output, you can represent a playing card however you want. as an example, a queen of diamonds might be represented as q-d, and a 9 of clubs might be represented as 9-c. you must use an object-oriented approach in designing and implementing this program.
Answers: 1
Предмет
Computers and Technology, 09.09.2019 18:10, mari530
Use c++ this assignment is a review of loops. do not use anything more advanced than a loop, such as programmer-defined functions or arrays or classes. if you know blackjack, you may be tempted to change the specifications below to make the game more "blackjack-like". don't. be sure to follow these specs exactly and don't try to improve on them. you will be penalized if the specs are not met exactly. in the card game named 'blackjack' players get two cards to start with, and then they are asked whether or not they want more cards. players can continue to take as many cards as they like. their goal is to get as close as possible to a total of 21 without going over. face cards have a value of 10. write a command line game that plays a simple version of blackjack. the program should generate a random number between 1 and 10 each time the player gets a card. each of the values (1 through 10) must be equally likely. (in other words, this won't be like real black jack where getting a 10 is more likely than getting some other value, because in real black jack all face cards count as 10.) it should keep a running total of the player's cards, and ask the player whether or not it should deal another card. if the player hits 21 exactly, the program should print "congratulations! " and then ask if the player wants to play again. if the player exceeds 21, the program should print "bust" and then ask if the player wants to play again. sample output for the game is written below. your program should produce the same output. if you'd like a little refresher on random number generation, see lesson 7.3. > first cards: 3, 2 > total: 5 > do you want another card? (y/n): y > card: 6 > total: 11 > do you want another card? (y/n): y > card: 7 > total: 18 > do you want another card? (y/n): n > would you like to play again? (y/n): y > > first cards: 10, 2 > total: 12 > do you want another card? (y/n): y > card: 6 > total: 18 > do you want another card? (y/n): y > card: 7 > total: 25 > bust. > would you like to play again? (y/n): n suggestion be sure to use iterative development. start with a small amount of functionality, and then grow it gradually. this way you can compile and run your program after each statement that you write. you might start by just generating a single card. the program execution might look like this: > first card: 3 then generate two cards > first cards: 3, 2 next add a variable to store the total, and a statement to show its value: > first cards: 3, 2 > total: 5 next read in a user response and print out the value that was entered > first cards: 3, 2 > total: 5 > do you want another card? (y/n): y > you entered: y next you might add a loop, without yet adding the blackjack logic > first cards: 3, 2 > total: 5 > do you want another card? (y/n): y > do you want another card? (y/n): y > do you want another card? (y/n): n now move the display of the total to the loop > first cards: 3, 2 > total: 5 > do you want another card? (y/n): y > total: 5 > do you want another card? (y/n): y > total: 5 > do you want another card? (y/n): n your next steps might be something like this: generate a new card in each loop and display the value update the total in each loop. check to see if the user busts in each loop wrap the game in loop that handles the play-again functionality
Answers: 1
Do you know the correct answer?
In the casino card game blackjack, the dealer gets two cards, one of which you can see and one that...

Questions in other subjects:

Konu
Mathematics, 04.08.2021 03:40