Тёмный

Monte Carlo Simulation in Python || Approximating π using randomness ! 

Younes Lab
Подписаться 2,3 тыс.
Просмотров 2,7 тыс.
50% 1

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@gabe_owner
@gabe_owner 10 месяцев назад
I'm gonna steal this demo for my list of unpopular party tricks.
@robsonde
@robsonde 10 месяцев назад
The quality of Pi is directly driven by the precision of your floating point math. I did this in Pascal in 1991, and than again with C++ and got a much closer value because C++ had float64 not float32. The real magic is doing it on paper with a dice.
@YounesLab
@YounesLab 10 месяцев назад
Thank you for pointing that out, it is important to consider float-precision when dealing with such problems.
@bommijn
@bommijn 10 месяцев назад
Fun small project.
@FeanorPhys
@FeanorPhys 6 месяцев назад
Thank you for this amazing explanation.
@ataractic
@ataractic 10 месяцев назад
simple but satisfying! nice explanation
@valn1xd873
@valn1xd873 10 месяцев назад
you can skip most of it and just count the pixels and divide
@YounesLab
@YounesLab 10 месяцев назад
This is a solution indeed. Though by counting the pixels, you have to count all the pixels, this can often be computationally heavy, but by randomly selecting a fraction of a group (or pixels) you reduce dramatically the computational time and achieve a satisfying precision. This technique is a core in Path Tracing, Physics related phenomena and so on...
@valn1xd873
@valn1xd873 10 месяцев назад
you can use the gpu to do those simple operations
@bartx3709
@bartx3709 10 месяцев назад
​​@@valn1xd873It's not about it. In this case it's just a circle but MC method can be great when what you're trying to estimate is some complicated integral of a more complicated function or area of some intricate shape.
@valn1xd873
@valn1xd873 10 месяцев назад
@@bartx3709 yeah, i understand, but i am an egineer so efficiency is the name of the game to me lol
@valn1xd873
@valn1xd873 10 месяцев назад
that reminds me of a time some math youtuber asked his subscribers to make some code thats faster than the code he wrote(that took hours to run) and people went crazy with it, doing some advanced code chemistry to squeeze every ms out of the code and got it to run in under a second
Далее
Is Computer Science still worth it?
20:08
Просмотров 346 тыс.
🛑самое главное в жизни!
00:11
Просмотров 34 тыс.
КОТЯТА В ОПАСНОСТИ?#cat
00:36
Просмотров 1,7 млн
Monte Carlo Simulation
10:06
Просмотров 1,4 млн
ASMR Programming - Spinning Cube - No Talking
20:45
Monte Carlo Simulation of a Stock Portfolio with Python
18:23
6. Monte Carlo Simulation
50:05
Просмотров 2 млн
🛑самое главное в жизни!
00:11
Просмотров 34 тыс.