Java uses math Example of calculating pi value by random () combined with Monte Carlo method
This article illustrates how Java uses math Random () combined with Monte Carlo method to calculate pi value. Share with you for your reference, as follows:
1、 Overview
Monte Carlo method, also known as statistical simulation method, is a very important numerical calculation method guided by probability and statistics theory, which was proposed in the mid-1940s due to the development of science and technology and the invention of electronic computer. It refers to the use of random numbers (or more common pseudo-random number) to solve many computational problems. Corresponding to it is deterministic algorithm.
For details, please refer to Baidu Encyclopedia: https://baike.baidu.com/item/%E8%92%99%E7%89%B9%C2%B7%E5%8D%A1%E7%BD%97%E6%96%B9%E6%B3%95
For more information about Java algorithms, readers who are interested can see the topics on this site: Java data structure and algorithm tutorial, summary of Java DOM node operation skills, summary of java file and directory operation skills, and summary of Java cache operation skills