Skip to main content

mc-tk

A Monte-Carlo toolkit for educational purposes.

pip install mc-tk

package architecture

experiments
    - classical / typical experiments in probability

distributions 
    - inclulde MC experiments that produce common distributions

samplings
    - sampling distributions of statistic used in hypothesis tests

The class diagram of the mc-tk package

modules and classes

Module Class Description
mc.experiments Pi Perform Buffon’s needle experiment to estimate π .
Parcel Simulate a bi-directional parcel passing game.
Dices Estimate the probabilities of various dice combinations.
Prisoners asymptotic_analysis() The famous locker puzzle(100-prisoner quiz). And the asymptotic_analysis() function will prove that the survival chance limit is 1−ln2 when n approaches +∞ .
Galton_Board Use the classic Galton board experiment to produce a binomial distribution.
Paper_Clips Use the paper clip experiment to produce a Zipf distribution.
Sudden_Death This class simulates a sudden death game to produce the exponential distribution.
mc.distributions Poisson This class will demonstrate that Poisson is a limit distribution of b(n,p) when n is large, and p is small.
Benford Verify Benford’s law using real-life datasets, including the stock market data, international trade data, and the Fibonacci series.
mc.samplings Clt Using various underlying distributions to verify the central limit  theorem. This class provides the following underlying distributions.
’uniform’ - a uniform distribution U(-1,1).
’expon’- an exponential distribution Expon(1).
’poisson’ - poisson distribution π(1).
’coin’- Bernoulli distribution with p = 0.5.
’tampered_coin’ - PMF:{0:0.2,1:0.8}, i.e., head more likely than tail.
’dice’- PMF:{1:1/6,2:1/6,3:1/6,4:1/6,5:1/6,6:1/6}.
’tampereddice’ - PMF: {1:0.1,2:0.1,3:0.1,4:0.1,5:0.1,6:0.5},i.e., 6 is more likely.
T_Test This class constructs an r.v.  (random variable) following the t distribution.
Chisq_Gof_Test Verify the statistic used in Pearson’s Chi-Square Goodness-of-Fit test follows the χ2  distribution.
Fk_Test Verify the Fligner-Killeen Test statistic(FK) follows the χ2  distribution.
Bartlett_Test Verify the Bartlett’s test statistic follows the χ2  distribution.
Anova Verify the statistic of ANOVA follows the F distribution.
Kw_Test Verify the Kruskal-Wallis test statistic (H) is a χ2  r.v.
Sign_Test For the sign test (medium test), verify its N- and N+ statistics both follow b(n,1/2).
Cochrane_Q_Test Verify the statistic T in Cochrane-Q test follows the χ2 distribution.
Hotelling_T2_Test Verify the T2  statistic from two multivariate Gaussian populations follows the Hotelling’s T2  distribution.

This version is major upgrade on the original version.
All the functions were refactored by the OOP (Object Oriented Programming) pattern.
McBase acts as a common base class for all MC derivative classes.

publication

JOSE paper

doc

API document

future plan

gui.py - add a Flask or tk-inter (ttkbootstrap) GUI

Metadata

Release files for mc-tk 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mc-tk 1.1.0
File Interpreter ABI Platform
mc_tk-1.1.0-py3-none-any.whl Python 3 none any Details

Release files / mc_tk-1.1.0-py3-none-any.whl

Download URL mc_tk-1.1.0-py3-none-any.whl
Size 829.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44036178aa76705d412634119734cb95b025cf691365e169721a993899409895
BLAKE2b-256 checksum
How to use checksums
2b4fdb14dafa2b83357c2a16d7a85626644f736978a46cf460ca007b71fa1baf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for mc-tk 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page