subject

In this problem, we will write a program to use a Monte Carlo simulation to approximate the area of the region of overlap of disks in the plane. Your program should take two command line arguments: the name of a file, and a long long int N representing the number of trials to conduct. The file will consist of an unknown number of lines, each with three doubles, separated by commas. The first two doubles on each line will represent the x and y coordinates respectively of a disk, and the third will represent its radius. The region of overlap is the set of points lying inside every one of the disks specified by the file. A Monte Carlo procedure to determine this area can be described very briefly as follows: (a) For N total trials, draw a point uniformly at random from a fixed large region S that contains all of the disks. (b) Determine the count of all trials for which the point randomly selected happened to lie within every one of the disks. (c) Calculate the probability that the randomly selected point happened to lie within every disk. (d) The area of the intersection of the disks will be approximately this probability multipled by the area of the region S. Report the result to the user using six decimal places of fixed precision. Some sample input files with approximate corresponding outputs are posted on Sakai. Note that your values are likely to vary from these due to the randomness involved.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:00
Ineed a good science fair name i’m doing a homemade water filter and i have no idea what the title should be plz
Answers: 1
question
Computers and Technology, 22.06.2019 04:30
Which of the statements below is true? the formatting, standard, and drawing commands are unavailable. the formatting, standard, and drawing commands have been used. the formatting, standard, and drawing toolbars are displayed. the formatting, standard, and drawing toolbars are hidden.
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Per the municipal solid waste report, what are the most common sources of waste (trash
Answers: 3
question
Computers and Technology, 23.06.2019 19:00
Now you’re on your own. include a short summary of this section with plots in your lab report. write a matlab script file to do steps (a) through (d) below. include a listing of the script file with your report. 1 the soundsc(xx,fs) function requires two arguments: the first one (xx) contains the vector of data to be played, the second argument (fs) is the sampling rate for playing the samples. in addition, soundsc(xx,fs) does automatic scaling and then calls sound(xx,fs) to actually play the signal. mcclellan, schafer, and yoder, dsp first, 2e, isbn 0-13-065562-7. prentice hall, upper saddle river, nj 07458. c 2015 pearson education, inc. 4 mcclellan, schafer and yoder, signal processing first. prentice hall, upper saddle river, new jersey, 2003. c 2003 prentice hall. (a) generate a time vector (tt) to cover a range of t that will exhibit approximately two cycles of the 4000 hz sinusoids defined in the next part, part (b). use a definition for tt similar to part 2.2(d). if we use t to denote the period of the sinusoids, define the starting time of the vector tt to be equal to t , and the ending time as ct . then the two cycles will include t d 0. finally, make sure that you have at least 25 samples per period of the sinusoidal wave. in other words, when you use the colon operator to define the time vector, make the increment small enough to generate 25 samples per period. (b) generate two 4000 hz sinusoids with arbitrary amplitude and time-shift. x1.t / d a1 cos.2
Answers: 1
You know the right answer?
In this problem, we will write a program to use a Monte Carlo simulation to approximate the area of...
Questions
question
World Languages, 07.05.2020 19:57
question
Social Studies, 07.05.2020 19:57
question
Mathematics, 07.05.2020 19:57
Questions on the website: 13722365