This repository contains a collection of Python-based computer assignments for the Engineering Probability and Statistics course at UT
These projects explore fundamental and advanced concepts in probability, statistical distributions, Bayesian inference, and the Central Limit Theorem, bridging theoretical mathematics with practical data analysis and simulation.
- Language: Python
- Environments: Jupyter Notebook
- Libraries:
NumPy,Pandas,Matplotlib,Seaborn,Scikit-Learn,SciPy,NLTK
- Majority Voting Simulation: Simulated the effect of individual voter accuracy on overall majority decision accuracy. Explored optimal individual accuracy thresholds and visualized the relationship using heatmaps.
- Spam Email Detection: Built a Naive Bayes Classifier from scratch to classify emails as spam or ham.
- Applied text preprocessing (lowercasing, punctuation removal).
- Implemented a Bag of Words (BoW) model.
- Handled unseen words using Laplace Smoothing.
- Optimized classification accuracy by filtering out stop words and handling probability underflows using logarithmic transformations.
- Hypergeometric vs. Binomial Distributions: Modeled an election fraud detection scenario, simulating sampling distributions and demonstrating how the Hypergeometric distribution converges to the Binomial distribution as population size approaches infinity.
- Normal Approximation & Continuity Correction: Analyzed an event RSVP scenario using the Binomial distribution's PMF and CDF. Compared the accuracy and computational time complexity of Binomial calculations against Normal distribution approximations (with and without continuity correction) to define a cost-effective computational strategy.
- Memorylessness of the Exponential Distribution: Simulated customer arrival times in a queueing system to practically prove the memoryless property of exponential distributions.
- Functions of Random Variables: * Implemented logarithmic transformations to convert Uniform distributions to Exponential distributions.
- Applied the Box-Muller Transform to generate standard Normal random variables from Uniform distributions.
- Joint & Conditional Distributions: Analyzed a simulated queueing system to extract and visualize the joint distributions of arrival, wait, and service times using Kernel Density Estimation (KDE) and scatter plots.
- Bayesian Estimation: Estimated the probability of a coin landing on heads using a Bayesian approach. Updated prior beliefs (starting with a Uniform distribution, then a Beta distribution) with new likelihood data to compute posterior distributions.
- Covariance & Correlation Analysis: * Processed time-series electricity consumption data (
energy.csv) using Pandasdatetimeutilities. - Visualized consumption variance across different years, months, and hours using boxplots.
- Investigated the difference between correlation and causation by analyzing confounding variables in demographic/health datasets (
TV_LE_Physician.csv).
-
The Central Limit Theorem (CLT): Conducted extensive sampling (sizes of 30, 300, and 3000) from Poisson, Exponential, and Geometric distributions. Visualized how the sample means converge to a Normal distribution as the sample size increases, calculating standard errors.
-
Mean Squared Error (MSE) Optimization: * Applied MSE optimization to estimate parameters
$a$ and$b$ for a linear regression model ($y = ax + b$ ). -
Utilized MSE to calculate the spatial center (centroid) of a scattered set of 2D points.
-
CLT in Bernoulli Trials: Explored the theoretical and practical application of approximating Binomial distributions with Normal distributions using Riemann sum coefficients for probability area matching.