Simulation Problems

This is a relatively new section in this site. I will update as many pages in this category. This will include new codes written in python the interesting patterns as an when observed. Click the titles to go to the respective pages.

Analysis of Shakespeare’s work using Python 3 After getting text from the webpages into text files,  these text files were imported into the python environment and an analysis was performed on it. The analysis of the complete works has resulted in the following observations. Presented below is the output of the python console. I have used Anaconda 4.2.0 with Python 3.5 version.The goal is to count the number of occurrences of each of the english alphabet.

Josephus Problem There are countless versions of this problem circulating in the internet. The problem is frequently stated as “100 people standing in a circle waiting to be executed in a specific sequence. The first person (person i) with the sword executes the person that is next in the circle (person i + 1) passing on the sword to the next person alive. This continues to go-on until only one person remains”.

ANOVA Package Python 3.5 Hello all. This page contains an algorithm for making the ANOVA analysis. You can download it for free and use it for your analyses. Please drop a comment when you download it.

Simulating rolls of Dice This is pretty simple. We will need a Uniform Random Number from 0 to 1 and then we need to use conditional statements used in conjunction with that do generate a dice. The algorithm is explained as follows.

City Bus Simulation Since we are counting entities here, I would model the boarding and the deboarding count as Poisson Random Variate.
The function called PoissonDistribution in wolfram mathematica takes values of λ greater than one and returns a random number when used with an enclosing function called RandomVariate
For this problem though we need to add an additional layer over the PoissonDistribution function to make sure that it does not crash when we pass in zero values. The zero values are also the rates because some of the stops at which the bus halts has no people boarding or in some other cases deboarding.
We will perform the simulation using the following steps
1.Simulate and get random data
2.Use the data for calculations and visualization.