Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need this program done in C Please do the entire code And please edit the code that i gave No other form will work

I need this program done in C
Please do the entire code
And please edit the code that i gave
No other form will work
Also provide screenshot please
image text in transcribed
image text in transcribed
Code Problem 1(20 points) Estimating e In this problem, we run random simulations to estimate e. We will not explain in detail the math behind it. Below is what we need to do. Fill in the count,n function in the value of_e.c file. The provided function uniform random a random number in the range [0,1). Repcatedly call this function, kceping track of the sum of random numbers generated, and stop when the sum exceeds 1. Return the count of random numbers generated. For example, if the first generated random number is 0.4864, since it does not exceed 1, we generate another number; suppose we get 0.3738. Our sum is 0.8602. Since that does not exceed 1, we generate another number; suppose we get 0.259. Our sum is now 1.1192. Since that does exceed 1, we do not generate another random number. Instcad, we return 3, the number of random numbers gencrated. include include //This is the function to generate a random number uniformly between double unifore_random return drand48); //In the following function, repeatadly ca all the function uniform_random keeping track of the //sum of random numbers generated, and stop when the sum exceeds 1. / /Return the count of random numbers generated. int count_nOt Put your code in here 3 int main(int argc, char** argv) 4 srand48 (1551142124); 5 int n 200800; 6 unsigned int totale; 7for (int i e i

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions