asmr coding PI value estimation in Pascal

Опубликовано: 23 Февраль 2023
на канале: Apnea Coding
58
2

This is an example code for estimating the value of 'pi'. The method is a trivial Monte-Carlo sampling upon a quarter-circle using built-in 'random'. Two different estimations are impleneted: (a) the average area under curve (AUC), which is the (randomized) integral of y=f(x)=sqrt(1-x*x) in [0,1], and (b) the area ratio between the quarter-circle and its bounding box. Since the AUC uses twice the number of samples, it should produce consistently better estimations.

Turbo Pascal 3.0 was one of those programming artworks of the early '80s, fitting an editor (external), a compiler, debugger and plenty of room to work with in just 64 KB of RAM. Similarly, it was one of the first programming tools (besides x86 Assemblers) to produce .COM executables directly, since the 'tiny' memory model was the default option at that time.

Enable captions for more details and walk-through. Source code available at the Github repository (see channel info).
#asmr #coding #programming #notalking #pascal #retro #msdos #dosbox


На этой странице сайта вы можете посмотреть видео онлайн asmr coding PI value estimation in Pascal длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Apnea Coding 23 Февраль 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 58 раз и оно понравилось 2 зрителям. Приятного просмотра!