In a football or soccer game, you have 22 players, from both teams, in the field. What is the probability of having any two players with the same birthday? (just assume 365 days a year and don’t have to do the exact calendar month and day, use the day number from 1 to 365)
Please use two approaches to solve the problem.
One, find the closed form mathematical solution by probability theory. Show your derivation/proof.
Two, write a program to simulate the birthday for each player per iteration and then tabulate the results in terms of occurrence of same birthdays over number of iterations. Do cases of 10, 50, 100 and 500 iterations, or more. The larger the number of iterations (samples), the closer the result is to the theoretical probability. What do you call this theory, or law? ( I’ve already given two-third of the name in the last sentence)
Hints:
For approach #1, you are free to do your research and study from the web, or any source, but do your own work.
For approach #2, the problem statement implies you need to do a match-search after generating the birthdays; and then do the booking keeping of the results for all iterations. Good opportunity to apply "arrays". And, before running it using srand() and rand() to generate the birthdays, put your ‘fixed’ data there to verify the search, book keeping and data output algorithms first.
PLEASE READ CAREFULLY THE QUESTION. THANK YOU!!
ScreenShot
----------------------------------------------------------------------------------------------------------------------
Program
//Header Files
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
//main method
int main()
{
//variable declaration
int playerCount = 22, count = 0, birthDays[22];
double p=0;//probability
//Number of trial for 10
for (int trial = 0; trial < 10; trial++)
{
//Randomly generate up to 22
players birthdays
for (int i = 0; i < playerCount;
i++)
{
//generate
random birth day betwee 1-365
birthDays[i] =
(rand() % 365) + 1;
//this loop
check if some birthday is equal to the one just generated
for (int j = 0;
j < i; j++) {
if (birthDays[j] == birthDays[i]) {
count = count + 1;
}
}
}
}
//calculate probability
p = count / 10;
//display probability
cout << "The probability of a
shared birthday in a team of 22(at trial 10) is " << p
<< endl;
return 0;
}
--------------------------------------------------------------------------------------------------------------------------
In a football or soccer game, you have 22 players, from both teams, in the field....
State the number of friends (or connections) that you have on Facebook (or Linkedin). In case you have more than 365 friends or connections, think of an alternative, smaller group of friends or relatives. What is the chance that there are at least 2 people among your friends (or connections) with the same birthday (same day, not same year)? Let's find out. Please respond with an estimate of the probability that this will happen. This estimate can be intuitive or...
One of the students in this class has created a game and would like for you to play. You have calculated that you will lose the game 45% of the time. At the same time you know that 30% of players will be paid $1 while 20% of players will be paid $2. It is calculated that all other players will receive the $100 prize. What is the expected value for this game? (Enter your solution as a decimal without...
Closing Case 1 Football Teams Use Virtual Reality The Problem College and professional football teams have a unique set of problems. First and foremost, teams would like to reduce the physical wear and tear of drills and practices on their players. In the National Football League (NFL), the most recent Collective Bargaining Agreement (2011) reduced the number of off-season practices, prohibited training camp “two-a-day” practices, and limited the number of contact practices in both the preseason and the regular season....
Currently, the game allows players to play as many times as they wish. It does not provide any feedback on how the players are doing, however. Modify the game so that it keeps track of the number of games played as well as the average number of guesses made per game. To implement this change, add the following list of global variables to the beginning of the script’s Main Script Logic section. Assign each variable an initial value of zero....
Monty Hall Problem - Suppose you are going to be on a game show, and you will be given the choice of three doors: Behind one door is a car; behind the other two doors are goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your...
The game lets players know whether they have won, lost, or tied a particular game. Modify the game so the players are told the number of games they have won, lost or tied since the start of game play. Implement this change by adding three variables named $wins, $lost, and $ties to the program's Main Script Logic section, assigning each an initial value of 0. Next, modify the analyze_results method by adding programming logic that increments the values of $wins,...
Assignment Specifications We are going to use the Monte Carlo Method to determine the probability of scoring outcomes of a single turn in a game called Pig. Your Task For this assignment you will simulate a given number of hold?at?N turns of a game called Pig, and report the estimated probabilities of the possible scoring outcomes. You are NOT implementing the game of Pig, only a single turn of this game. The value of N will be acquired via user...
please give answer in a,b,c,d format. give calculation.
1.5.18 Have you ever played rock-paper-scissors (or Rochambeau)? It's considered a "fair game" in that the two players are equally likely to win (like a coin toss). Both players simultaneously display one of three hand gestures (rock, paper, or scissors), and the objective is to display a gesture that defeats that of your opponent. The main gist is that rocks break scissors, scissors cut paper, and paper covers rock. We investigated some...
C LANGUAGE. PLEASE INCLUDE COMMENTS :)
>>>>TheCafe V2.c<<<<
#include <stdio.h>
int main()
{
int fries; // A flag denoting whether they want fries or not.
char bacon; // A character for storing their bacon preference.
double cost = 0.0; // The total cost of their meal, initialized to start at 0.0
int choice; // A variable new to version 2, choice is an int that will store the
// user's menu choice. It will also serve as our loop control...
C++ Inheritance Problem Step a: Suppose you are creating a fantasy role-playing game. In this game we have four different types of Creatures: Humans, Cyberdemons, Balrogs, and elves. To represent one of these Creatures we might define a Creature class as follows: class Creature { private: int type; // 0 Human, 1 Cyberdemon, 2 Balrog, 3 elf int strength; // how much damage this Creature inflicts int hitpoints; // how much damage this Creature can sustain string getSpecies() const; //...