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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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