Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Overview: Rumors (Exercise 1.4.30). Alice is throwing a party with n other guests, nclud ing Bob. Bob starts a rumor about Alice by telling it

image text in transcribed
Overview: Rumors (Exercise 1.4.30). Alice is throwing a party with n other guests, nclud ing Bob. Bob starts a rumor about Alice by telling it to one of the other guests. A person hearing this rumor for the first time will immediately tell it to one other guest, chosen u formly at random from all the people at the party except Alice and the person from whom they heard t. If a person including Bob) hears the rumor for the second time, he or she will not propagate it further. Write a program to estimate the probability that everyone at the party (except Alice w hear the rumor before it stops propagating. Also calculate an estimate of the expected number of people to hear the rumor Details: Name the program PP1.java Your program must use two command ine parameters. The first is an integer for the number of guests. The second is an integer for the number of simulation runs to conduct to estimate the probabilities. Validate the command ine parameters. If not enough parameters or invalid values are given then print out a warning message Your program should output your name and lab CRN as the first e. The second line of output should be the run details (number of guests and number of simulation runs) The third line of output should the two probabilities. Provide a readme.txt that contains the estimates from the following runs: java PP1 1 10 java PP1 2 10 java PP1 3 10 -java PP1 4 100 java PP1 5 1000 -java PP1 10 1000 Note: you y se I/O redirection to add outpu to readme.txt file . Remember to test your command e validation with runs such as - java PP1 -2 10 -java PP1 10 -2 -java PP1 Your program code style should follow the style guidelines posted on the course BrightSpace page Submit the source code file PP1.java and the readme.txt file to Dropbox on Brightspace Overview: Rumors (Exercise 1.4.30). Alice is throwing a party with n other guests, nclud ing Bob. Bob starts a rumor about Alice by telling it to one of the other guests. A person hearing this rumor for the first time will immediately tell it to one other guest, chosen u formly at random from all the people at the party except Alice and the person from whom they heard t. If a person including Bob) hears the rumor for the second time, he or she will not propagate it further. Write a program to estimate the probability that everyone at the party (except Alice w hear the rumor before it stops propagating. Also calculate an estimate of the expected number of people to hear the rumor Details: Name the program PP1.java Your program must use two command ine parameters. The first is an integer for the number of guests. The second is an integer for the number of simulation runs to conduct to estimate the probabilities. Validate the command ine parameters. If not enough parameters or invalid values are given then print out a warning message Your program should output your name and lab CRN as the first e. The second line of output should be the run details (number of guests and number of simulation runs) The third line of output should the two probabilities. Provide a readme.txt that contains the estimates from the following runs: java PP1 1 10 java PP1 2 10 java PP1 3 10 -java PP1 4 100 java PP1 5 1000 -java PP1 10 1000 Note: you y se I/O redirection to add outpu to readme.txt file . Remember to test your command e validation with runs such as - java PP1 -2 10 -java PP1 10 -2 -java PP1 Your program code style should follow the style guidelines posted on the course BrightSpace page Submit the source code file PP1.java and the readme.txt file to Dropbox on Brightspace

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Project Management in Practice

Authors: Samuel J. Mantel Jr., Jack R. Meredith, Sco

4th edition

470533013, 978-0470533017

Students also viewed these Databases questions

Question

What is the best conclusion for Xbar Chart? UCL A X B C B A LCL

Answered: 1 week ago