Chapter 6: Problem 34
Write a program that simulates coin tossing. For each toss of the coin, the program should print Heads or Tails. Let the program toss the coin 100 times and count the number of times each side of the coin appears. Print the results. The program should call a separate function flip that takes no arguments and returns \(\theta\) for tails and 1 for heads. [Note: If the program realistically simulates the coin tossing, then each side of the coin should appear approximately half the time.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.