Skip to content

Latest commit

 

History

History
executable file
·
13 lines (7 loc) · 1.86 KB

Swift Playground Description.md

File metadata and controls

executable file
·
13 lines (7 loc) · 1.86 KB

Swift Playground

Tell us about the features and technologies you used in your Swift playground.

When I was studying random number generation during my AP computer science class, I learned about Monte Carlo Method to calculate pi. I was able to realize the same thing in Java soon after. I was curious about the limits of this method and decided to test it. I ran my Mac overnight and found that the accuracy did not improve. I inevitably asked myself: How can I improve this? But I wasn't able to spend any extra time to figure that one out. Months later, for this playground, I tried to figure out alternative methods to calculate pi.

In this playground, you will first use a visualized Monte Carlo method to calculate pi. Then, you will visually check the Leibniz formula and Basel problem to calculate pi. Lastly, you will visually test which is the most stable and accurate way to calculate pi.

There are no fancy technologies in this playground. Only UIKit and PlaygroundSupport are in it, and that's pretty much it. But I think what matters the most is the content inside the box, not the package. By myself, I developed a simple yet an elegant way to quickly compare an infinitesimal difference in long decimal numbers (called the Disco Level.). In addition, I designed my own graph API that can not only display Cartesian coordinates for Monte Carlo Method's visualization but also scatterplots and graphs for comparing the Monte Carlo method and the accuracy of other alternatives, also without any kind of help.

Since this is my first project done in Swift, I had to learn Swift syntax in only a few days. I think the most important thing is not "how good you are right now," but "how you will be able to improve upon yourself" in the future. Please try to see my potential and the scientific insight in this playground. Thank you.

Written by Sunghyun Cho on March 31st, 2018.