# Individual Programming Assignment | Buy Assignments Online

CSC 540 INDIVIDUAL PROGRAMMING ASSIGNMENT, HW3

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.

Your simulation has to do with a bottle of vitamin pills. The bottle of pills starts out with N pills. (More on N in a moment.) You need to take one half of a pill each day. Each day, you pull out a pill from the bottle. Assume that any pill is the bottle is equally likely to be selected. If you pull out a whole pill, then you break that pill in half, swallow one of the halves, and put the other half back in the bottle. If you pull out a half pill, then you swallow that half pill.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.

We are interested in tracking the ratio of half pills to all the pills left in the jar. When you start with a new jar of N whole pills, there are no half pills at all, so the ratio is 0/N. When you get down to the last half pill in the jar (and no whole pills), then the ratio is 1/1. In between, what does that ratio look like? You are going to use random simulation to find out.

Start with a full jar of all whole pills. (Perhaps you should use an array for this; each entry in the array would be able to record if a pill was a half or a whole pill.) Randomly pick one of the pills left in the jar. If  that pill is a whole pill, change it to a half pill. If that pill is a half pill, then remove that pill from the jar. (Somehow that array entry should “disappear,” and the array should become shorter; there are different ways to do this.)

After each pill is chosen, determine the ratio of half pills to all pills. For a jar holding N whole pills, your simulation will randomly choose a pill 2*N times before the jar is empty.

Assume at first that your jar holds 50 pills. Fill up the jar with 50 whole pills, and empty that jar, keeping track of the ratio each time a pill is chosen. You should finish with an empty jar after 100 simulated days. Now do the same experiment 3 more times, yielding 400 data points.

Now take the average of the 4 data points on day 1, day 2, and so one for all 100 days. Now you will have 500 data points in 5 series.

Finally, do exactly the same thing, but this time use 100 pills. Again, do 4 repetitions, and then average.

Calculate the price
Pages (550 words)
\$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with Homework Writing Services
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Other
Although I did not receive my paper on time, the customer care team ensured that I would receive a quality paper. I am pleased with the revision of this paper.
Customer 452455, March 2nd, 2023
Good work.
Customer 458115, June 9th, 2022
Health Care
Good job
Customer 454209, June 2nd, 2020
Beauty
Instructions met.
Customer 452441, May 3rd, 2022
History
Extremely well written, perfect for what I needed
Customer 454393, May 21st, 2020
Nursing
Thanks a lot Peter
Customer 453199, March 28th, 2020
Thanks! Looks Great!
Customer 453375, December 4th, 2021
Healthcare & Medical
Great work.
Customer 452441, May 11th, 2022
Other
Great job in such a short time. Thank you.
Customer 462927, May 4th, 2022
English 101
Satisfactory. However, always go through instructions before submitting to identify omissions.
Customer 462843, April 11th, 2022
Ethics
Thank you!!!
Customer 454087, June 19th, 2020
Psychology
Absolutely wonderful speech! Thank you so much!
Customer 462815, April 20th, 2022
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend