Principles of Soft Computing Using Python Programming by Nandi Gypsy;

Principles of Soft Computing Using Python Programming by Nandi Gypsy;

Author:Nandi, Gypsy; [Nandi, Gypsy]
Language: eng
Format: epub
Publisher: John Wiley & Sons, Incorporated
Published: 2023-12-19T00:00:00+00:00


The output of Program 5.1 is displayed below. The output of the program will vary, since it involves random card selection. The program randomly selects a card from the deck. In this example, the selected card is the 4 of diamonds. Then, both the odds and risks are calculated for the event of drawing a heart. The output 0.33 indicates that the probability of drawing a heart from the deck is 33%, and the output 0.75 indicates that the risk associated with drawing a heart is 75%.

Also, the odds and risks are calculated for the event of drawing a face card (Jack, Queen, or King). The output 0.3 indicates that the probability of drawing a face card is 0.3. This means that there is approximately 30% chance of selecting a face card from the deck. Lastly, the output 0.769 indicates that the risk associated with drawing a face card is 0.769. This means that there is approximately a 76.9% chance of not selecting a face card from the deck.

Randomly selected card: ('4', 'Diamonds') Odds of drawing a heart: 0.3333333333333333 Risk of drawing a heart: 0.75 Odds of drawing a face card: 0.3 Risk of drawing a face card: 0.7692307692307693

The output provides insights into the likelihood (odds) and potential negative outcomes (risk) associated with the events of drawing a heart or a face card from the deck of cards. Knowledge about probability helps us in making decisions on what is likely to occur based on an estimate or on the previous real-time collected data. A data analyst often uses probability distributions of data for various statistical analyses.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.