T computes and posters the probabilities of two people

Assignment Help C/C++ Programming
Reference no: EM13168014

Write a C program that computes and posters the probabilities of two people in a group who are born in the same day. The probability of two people being born in the same day of the year, for a group of npeople, is given by the following formula:

P (n) = 1 - 365/365 x 364/365 x 363/365 x ... x (365-n+1)/365

Thus, if n=1, p (1) = 1- 365/365 = 0

If n=2, p (2) = 1- 365/365 x 364/365 = 0.002740; about 0.27%

If n=3, p (3) = 1- 365/365 x 364/365 x 363/365 = 0.008204; about 0.82%

Etc.

Your program must compute the probabilities of the 10 groups of 4, 8, 12, ...40 people and must print the results according to the following presentation :

Probability of 2 identical birthdays in a group of 4 people :   1.64%

Probability of 2 identical birthdays in a group of 8 people :   7.43%

...

Probability of 2 identical birthdays in a group of 40 people :   89.12%

 

Remarks:

-There is no reading of data to perform. The printing of the probability is expressed as a percentage with the specification of the conversion %5.2lf.To avoid any overflow capacity, use the type double in your calculations.

-You must use some comments such as:

Description of the program (author, purpose)

Description of the constants and/or the variables

-Your program must use the instruction for to compute the probabilities

 

 

Reference no: EM13168014

Questions Cloud

Create a console-based application named multiplication : a. Create a console-based application named Multiplication whose main() method asks the user to input and then calls a method named MultiplicationTable(), which displays the results of multiplying the integers by each of the number 2 through 10
Takes n number of element from user : Write a C program which takes n number of element from user (where, n is specified by user) and stores data in an array. Then, this program displays the largest element of that array.
What structure best represents the rate-determining : What structure best represents the rate-determining intermediate formed when 1-methylcyclopentene reacts with Cl2.
Calculate the number of excess reagent units remaining : calculate the number of excess reagent units remaining when 100 C4H10 molecules and 611 O2 molecules react?
T computes and posters the probabilities of two people : Write a C program that computes and posters the probabilities of two people in a group who are born in the same day. The probability of two people being born in the same day of the year, for a group of  n people, is given by the following formula:
What volume will the gases expand against a constant : 1119. J of energy, to what volume will the gases expand against a constant pressure of 645. torr if all the energy of combustion is converted into work to push back the piston?
Requires the number of bits for the exponent : Write a program that requires the number of bits for the exponent and significant of a Floating Point representation; then requires two decimal real numbers and an operation either sum
Find energy are necessary to heat the air : A room contains 47kg of air. How many kilowatt-hours of energy are necessary to heat the air in the house from 7 degrees celsius to 26 degrees celsius
What is the boiling point at an elevation : the normal boiling point for mercury is 357c. what is the boiling point at an elevation where the atmospheric pressure is 635 torr.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  The second argument to the function is the string

The function fnUserBinaryInputX has 2 input arguments, each is a string. The first string is the "prompt" string displayed to the user when asked to enter a string. The second argument to the function is the string to compare the user entered stri..

  The minimal spanning tree algorithm

discuss the minimal spanning tree algorithm. Describe the advantages and disadvantages of this algorithm. List the circumstances best suited for the minimal spanning tree algorithm.

  Machine that i would like to know

Let's say I have a machine that I would like to know, on average, how much it runs throughout a given day through a percentage value. Every 30 seconds, I will have a device to record the current temperature of the machine. If the machine increases..

  Write a function that takes an integer array

1. Write a function that takes an integer array and the array's size as parameters. The function will check if the array is sorted. If it is, it will return a 1. If it is not sorted it will return 0. The function should not  sort the array.

  Write a function sum3darray

Write a function sum3DArray. This function will take a three dimensional array of ints and add all the entries in the three dimensional array. Assume columns and rank are two constants already defined.

  Write a program to calculate existing angles

Write a program to calculate existing angles and do if and then from this, and to place fixed angles at certain position.

  Ng stands for next guess

Where NG stands for next guess and LG stands for last guess. Write a function that calculates the square root of a number using this method. The initial guess will be the starting value of LG .

  Throws an exception from a deeply nested

Write a program that throws an exception from a deeply nested function and still has the catch handler following the try block enclosing the initial call in main catch the exception

  Dealerships are awarded the rebate

Dealerships are awarded the rebate on a quarter-by-quarter basis, only for quarters where their actual sales exceeded expected volumes for that quarter. Expected sales volumes for each quarter are as follows:

  Wrtie a function called gen_rand_double_array

Wrtie a function called gen_rand_double_array that generates 900 samples of size 22500 random numbers from U(10, 12). For each of these 900 samples, write a main funciton that calculates the mean and finds the simulated probability that the mean is b..

  The manager of a football stadium

The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets-box, sideline, premium and general admission. The data is stored in a file, tickets.txt, in the fol..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd