You are given a black box that has either a standard 52-card deck-of-cards or a
ID: 3884733 • Letter: Y
Question
You are given a black box that has either a standard 52-card deck-of-cards or a 48-card deck-of-cards for the game pinochle. You are allowed to activate the box once, upon which a card is chosen at random and you are given the card. In pseudocode, give an algorithm that activates the box once and then guesses either "standard" or "pinochle". Evaluate the advantage your algorithm achieves. In this problem you can maximize your advantage by identifying all of the cards that are more likely with one type of deck and guess that type of deck if any of those cards appear.Explanation / Answer
Observe the following about the pinochle card deck:
1. Two copies of 9, 10, jack, queen, king and ace of each of the four suits.
2. So, total number of cards = 2 * 4 * 6 = 48.
key point: If the card is one of the above cards, it is most likely to be in pinochle card desk.
Otherwise it is most likely to be in the standard card desk.
ALGORITHM:
1. pinochle_cards = {9, 10, jack, queen, king, ace}
2. card = ActivateBox
3. If card is in pinochle_cards:
print ('The card most likely is from pinochle deck')
Else:
print ('The card most likely is from regular deck')
Explanation:
1. First of all we make an array containing the cards of pinochle card deck.
2. If any of these cards are seen, it is most likely from pinochle card deck because this deck contains two of each card.
3. We print out the result
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.