Welcome to the repository for some general simulations! ๐ฎ Here, we explore various simulations implemented in C++ to gain insights into different phenomena.
The first simulation included is the Luck and Hard Work simulation, inspired by a Veritasium video (A YouTube Channel). In this simulation, we model the selection process for NASA astronauts, considering factors like skill, experience, and luck. The number of applicants and selected candidates is as per the 2017 application process. The simulation generates random skill and luck scores for a pool of applicants and selects top candidates based on their overall scores.
To run the Luck and Hard Work simulation, compile and execute the provided C++ code. The simulation iterates multiple times for accurate results. You can adjust the number of iterations for detailed analysis.
After running the simulation, you'll obtain insights into the average luck score of selected candidates.
Average Luck Score: 97.1016
This highlights the significant role luck plays in the selection process alongside skill and hard work. Note: While luck may play a role, remember to stay dedicated and work hard towards your goals. Who knows, maybe a lucky break is just around the corner! "Luck can open doors, but it takes skill to keep them open."
In probability theory, the law of large numbers is a fundamental theorem that describes the behavior of averages of random samples. It states that the average of the results obtained from a large number of independent and identically distributed random samples converges, in some sense, to the true value, if it exists.
There are two perspectives of calculating probabilities:
Theoretical probability is based on mathematical principles and assumes ideal conditions, where all outcomes are equally likely. It is calculated using theoretical formulas under idealized scenarios.
Practical probability, also known as empirical probability, is based on observed data from experiments or real-world events. It involves estimating probabilities based on actual outcomes. To illustrate, consider the probability of rolling a six on a fair six-sided die:
The theoretical probability of rolling a six is 1/6, assuming each face of the die is equally likely. However, in practice, the observed probability might differ based on the outcomes of actual die rolls.
The law of large numbers, attributed to Jakob Bernoulli, states that although practical (empirical) probabilities may diverge from theoretical probabilities for small sample sizes, as the sample size increases, the practical probability tends to converge towards the true (theoretical) probability.
In summary, the law of large numbers underscores the relationship between observed frequencies and underlying probabilities, demonstrating that with a sufficiently large number of trials or samples, empirical probabilities approach theoretical probabilities.
In the code section of the repository, practical demonstrations are showcased using Python libraries matplotlib and numpy. These demonstrations illustrate the law of large numbers for both dice rolls and coin tosses.
Below is an example execution of the program, demonstrating how the probability of rolling a 3 with a die converges to the true value as the sample size increases.
DEMO Execution
For getting 3 in 100 die rolls
For getting 3 in 1000 die rolls
For getting 3 in 1000000 die rolls
This repo consists of a python script aimed at generating Primes of different types till a specified range.
Primes such that they are only divisible by 1 and themselves
Primes such that the sum of digits is a prime
Primes of the form n! โ 1 or n! + 1
Primes in the Fibonacci sequence
Primes that eventually reach 1 under iteration of: x -> sum of squares of digits of x
Primes of the form 2^n - 1
Primes such that the product of digits is a prime
A palindromic prime is a prime number that is also a palindromic number
Primes of the form 4n + 1
A safe prime is a prime number of the form 2p + 1, where p is also a prime
DEMO Execution
Fibonacci primes till 100
Palidromic primes till 100
This repository aims to expand its simulations to explore various scenarios and factors influencing success. Stay tuned for updates as we delve deeper into understanding different phenomena through simulations! Feel free to contribute, provide feedback, or suggest ideas for future simulations. Let's continue exploring the world of simulations together! ๐