1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Free_Kalibri [48]
4 years ago
12

The birthday problem is as follows: given a group of n people in a room, what is the probability that two or more of them have t

he same birthday? It is possible to determine the answer to this question via simulation. Using the starting template provided to you, complete the function called calc birthday probability that takes as input n and returns the probability that two or more of the n people will have the same birthday. To do this, the function should create a list of size n and generate n birthdays in the range 1 to 365 randomly, inclusive of the end-points 1 and 365. It should then check to see if any of the n birthdays are identical. The function should perform this experiment 106 times and calculate the fraction of time during which two or more people had the same birthday. The function will be called as follows from your main program:
IN PYTHON PLEASE

import random

def calc_birthday_probability (num_people):

random.seed (2020) # Don't change this value

num_trials = 1000

probability = 0
""" FIXME: Complete this function to return the probability of two or more people in the room having the same birthday. """

return probability
Computers and Technology
1 answer:
Vladimir [108]4 years ago
5 0

Answer:

He had a nearly 71% chance that 2 or more of us would share a birthday.

Explanation:

You might be interested in
Estan clasificadas como piezas alargadas y dentada<br>​
hodyreva [135]

Answer:

Estan clasificadas como piezas alargadas y dentada

when you turn the setence above me to english it means

They are classified as elongated and toothed pieces

Explanation:

7 0
3 years ago
Passing by reference is used if a parameter's data flow is A. one-way, into the function. B. one-way, out of the function. C. tw
tiny-mole [99]

Passing by reference is used if a parameter's data flow is two-way, into and out of the function.

C. two-way, into and out of the function.

<u>Explanation:</u>

If a function in programming language passing the parameter by reference means it only sending the address of parameter to a function. If any value is changed on reference parameter it will changed original value.

If parameter passed by value means it is one way, where value been send to the function.

Whereas by reference means it two-way, in and out of the function. Mostly it called as pointer.

It is available in c , c++, where declare of variable “*” or “&” address off.

4 0
4 years ago
Normal view
Amiraneli [1.4K]
Normal View is the place where creating and editing occurs slide panel. This is where you can write or edit kind of information or images you wanted to show in your power point presentation. 
3 0
3 years ago
Read 2 more answers
Write a program to calculate the volume of a cube which contains 27 number of small identical cubes on the basis of the length o
Brrunno [24]

Answer:

<em>This program is written in python programming language.</em>

<em>The program is self explanatory; hence, no comments was used; However, see explanation section for line by line explanation.</em>

<em>Program starts here</em>

length = float(input("Length of small cube: "))

volume = 27 * length**3

print("Volume: "+(str(volume)))

Explanation:

The first line of the program prompts the user for the length of the small cube;

length = float(input("Length of small cube: "))

The volume of the 27 identical cubes is calculated on the next line;

volume = 27 * length**3

Lastly, the calculated volume of the 27 cubes is printed

print("Volume: "+(str(volume)))

4 0
3 years ago
Create a recursive method, a method that calls itself, that returns true or false depending on whether or not a given string is
ICE Princess25 [194]

Answer:

public class CheckPalindrome{

public static boolean IsPalindrome(String str){

if(str.Length<1)

{

return true;

}

else

{

if(str[0]!=str[str.length-1])

return false;

else

return IsPalindrome(str.substring(1,str.Length-2));

}

}

public static void main(string args[])

{

//console.write("checking palindromes");

string input;

boolean flag;

input=Console.ReadLine();

flag= IsPalindrome(input);

if(flag)

{

Console.WriteLine("Received"+input+"is indeed palindrome");

}

else

{

Console.WriteLine("received"+input+"is not a palindrome");

}

}

Explanation:

6 0
3 years ago
Other questions:
  • The ____ loop stops when the loop has processed every element in an array.?
    7·1 answer
  • A spreadsheet has some values entered: Cell A1 contains 10, cell A2 contains 14, cell A3 contains 7. You enter in cell A4 the fo
    15·2 answers
  • In social networking websites such as twitter, people leave narrow minded and subjective remarks and upload unacceptable videos.
    9·1 answer
  • Which of the following is not a metamorphic agent?
    8·2 answers
  • A frameset should only be used with XHTML true or false
    11·1 answer
  • Website hosting servers have their own unique IP address, what does this address consist of?
    8·1 answer
  • Mha rp anyone? ima be baby shoto
    14·2 answers
  • Which cable between Twisted-Pair-Cable (TPC) and Coaxial-Cable (CC) work for transmitting data to more distances?
    9·1 answer
  • 9.
    8·1 answer
  • How communication skills are different from self management skills
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!