Stat Mania Logo. Stat Mania Logo. Stat Mania
  • Home
  • Tags
  • Categories
  • Portal
  • About
Categories
AI
algorithm
anova
business
C
CLI
DevOps
discrete distributions
dispersion
Explainer
GIS
Git
LaTeX
Learning
Linux
Mathematics
ML
package
probability
Programming
Python
Quarto
quarto
R
reading
recreational-math
regression
research
Shell
Statistics
statistics
Teaching
theory
time-series
Tips
Tools
Troubleshooting
Tutorial
writing

Statistics, Mathematics, and Data Science, explained with code

crloopscontrol-flowcommand-linemore ›

Tutorials, theory and dev notes on statistics, mathematics, Linux, C, R, and Python.68 posts40 topicsupdated Oct 2026RSS

Why Critical Thinking Matters More in the AI Age
4 min
Learning
AI

AI can be confidently wrong, biased and easy to over-trust. Six reasons critical thinking has become a survival skill: hallucinations, bias, asking the right questions…

Abdullah Al Mahmud
Oct 20, 2026

Why Use break in a while Loop If the Condition Already Stops It?
4 min
C
Programming
Tutorial

If a loop runs while i < 10 but breaks at 4, why write i < 10 at all? The condition is the planned exit and break is the exit for a special case. Four short examples…

Abdullah Al Mahmud
Oct 19, 2026

Printing a Comma-Separated List in C (No Trailing Comma, Clean Line Breaks)
6 min
C
Programming
Tutorial

How to print 0, 1, 2, … with commas in C: why a plain printf glues the numbers together, four ways to avoid the trailing comma, and how works in nested loops for rows…

Abdullah Al Mahmud
Oct 19, 2026

Shortcut Ways to Write if in C: the Ternary Operator and More
7 min
C
Programming
Tutorial

Shorten an if to one line by dropping the braces, write an if-else with the ternary operator ?:, and use other shortcuts: testing a value directly and using a comparison as…

Abdullah Al Mahmud
Oct 19, 2026

Double Summation (ΣΣ) in Statistics, and How to Code It in C
5 min
C
Statistics
Tutorial

What a double sum means, why statistics keeps using it (grand mean, total sum of squares, ANOVA), and how two nested for loops in C compute it, with a short store-sales…

Abdullah Al Mahmud
Oct 19, 2026

How to Write a Multiline Git Commit Message (4 Methods)
5 min
Git
DevOps
Tutorial

Four ways to write a commit message with a subject and a body: the default editor, several -m flags, quotes that span lines, and a message file. Plus the conventions that…

Abdullah Al Mahmud
Oct 19, 2026

Why Learn a Programming Language in the AI Age?
6 min
Programming
Learning
AI

AI can write code in seconds, so why bother learning to code? Eight reasons it still matters: directing the AI, knowing how the system works, emergencies, saving tokens for…

Abdullah Al Mahmud
Oct 19, 2026

pdfLaTeX vs XeLaTeX: Which LaTeX Engine Should We Use?
5 min
LaTeX
Tools
Tutorial

pdfLaTeX is fast and compatible with almost every package; XeLaTeX uses system fonts and native Unicode. How they differ, how to switch in the terminal, Overleaf and…

Abdullah Al Mahmud
Oct 18, 2026

5 for Loop Practice Problems in C (with Hints and Solutions)
7 min
C
Programming
Tutorial

Five for-loop exercises in C, from a multiplication table to a star triangle: each with a task, expected output, a step-by-step hint, a tested solution, and a harder…

Abdullah Al Mahmud
Oct 17, 2026

5 Nested for Loop Practice Problems in C (with Hints and Solutions)
8 min
C
Programming
Tutorial

Five nested for-loop exercises in C: a rectangle, a multiplication grid, a number triangle, a centred pyramid and a checkerboard. Each has expected output, a hint and a…

Abdullah Al Mahmud
Oct 17, 2026

Declaring Multiple Variables in One Line in C
5 min
C
Programming
Tutorial

How to declare several C variables in one statement (int a, b, c;), initialise them, and avoid the traps: partial initialisation, the pointer asterisk, mixed types and…

Abdullah Al Mahmud
Oct 15, 2026

Why Programming Counts from Zero (and Why R Counts from One)
10 min
Programming
C
Python
R
Explainer

Why C and Python start indexing at 0, why R starts at 1, with everyday analogies, tested code in C, Python and R, and a table of advantages and disadvantages of both.

Abdullah Al Mahmud
Oct 15, 2026

Handy Linux Shell One-Liners for Everyday File Tasks
5 min
Linux
Shell
Tutorial

Short, tested Linux shell commands: clean up text with sed, count files with find, rename files in bulk (sequential numbers, hyphens, lowercase), and convert mp4 to mp3 with…

Abdullah Al Mahmud
Oct 14, 2026

Recursion in R: Functions That Call Themselves
4 min
R
Programming
Tutorial

How recursion works in R: base case and recursive case, indirect recursion, Recall(), recursion on nested lists, R’s depth limits, and memoisation, with tested examples.

Abdullah Al Mahmud
Oct 14, 2026

How to Test a Small C Snippet Quickly
3 min
C
Programming
Tips

The fastest ways to try a few lines of C: online compilers, a one-line gcc build-and-run command, editor shortcuts, and feeding input from a file.

Abdullah Al Mahmud
Oct 13, 2026

Pre-Increment vs Post-Increment in C: ++i vs i++
3 min
C
Programming
Tutorial

The difference between ++i and i++ in C: when the value changes, what the expression returns, with compiled examples, and why it only matters inside larger expressions.

Abdullah Al Mahmud
Oct 11, 2026

Checking User Input in C: Is It Really a Number?
3 min
C
Programming
Tutorial

How to check that user input is a valid integer in C, using scanf’s return value and a stricter fgets + strtol check, with a factorial example.

Abdullah Al Mahmud
Oct 11, 2026

How to Reduce Fan Noise in a Linux Laptop Microphone
3 min
Linux
Troubleshooting

Why the internal microphone picks up the cooling fan on Linux, and five practical fixes: lower the gain, enable noise suppression, tame power profiles, clean the vents, or…

Abdullah Al Mahmud
Oct 10, 2026

How to Save Loop Results in an Array in C
4 min
C
Programming
Tutorial

Declare a fixed-size array, fill it with a for loop using the loop index, and grow it with malloc() and realloc() when the number of values is not known in advance.

Abdullah Al Mahmud
Oct 7, 2026

5 while Loop Practice Problems in C (with Hints and Solutions)
8 min
C
Programming
Tutorial

Five while-loop exercises in C, from printing even numbers to reversing a number: each with a task, expected output, a step-by-step hint, a tested solution, and a harder…

Abdullah Al Mahmud
Oct 4, 2026

How This Blog Is Built: Quarto, One Python Hook and One Shell Command
7 min
Tools
Quarto
Tutorial

A tour of a static Quarto blog on GitHub Pages: the folder layout, a pre-render script that feeds a dynamic archive, tag cloud and related posts, a dark/light toggle, and a…

Abdullah Al Mahmud
Oct 4, 2026

How I Make Statistics Lecture Slides with Quarto and reveal.js
6 min
Tools
Quarto
Teaching

One shared config, one .qmd per chapter: how Quarto and reveal.js turn Markdown, LaTeX math and R code into lecture decks, with a custom theme, drawing on slides, and a…

Abdullah Al Mahmud
Oct 4, 2026

srand(time(NULL)) in C: Why Random Numbers Repeat and How to Seed Them
5 min
C
Programming
Tutorial

What srand(time(NULL)) really does: why rand() repeats the same numbers without a seed, how time(NULL) fixes that, the unsigned cast, the same-second trap, and why we seed…

Abdullah Al Mahmud
Oct 3, 2026

Tossing a Die in C Until We Get a 6
7 min
C
Programming
Tutorial

Track every roll of a die in C: print as we go, store the history in an array, tally frequencies, and list which steps produced each face.

Abdullah Al Mahmud
Oct 2, 2026

float vs double in C: Precision, Memory, and When to Use Which
5 min
C
Programming
Tutorial

How C’s float and double differ in precision, size, range, literals and format specifiers, with real compiler output showing where float goes wrong.

Abdullah Al Mahmud
Sep 26, 2026

The switch Statement in C: Syntax, break, Fall-Through and Examples
7 min
C
Programming
Tutorial

How C’s switch statement works: matching cases, break, default, deliberate fall-through, grouped cases, chars and enums, and when to choose switch over if / else if.

Abdullah Al Mahmud
Sep 26, 2026

10 Short Real-World C Programming Examples (if + Loop Patterns)
8 min
C
Programming
Tutorial

Ten compact C snippets — from an ATM PIN check to a vending machine — each pairing a loop for repetition with an if for decision-making, with the real-world problem and a…

Abdullah Al Mahmud
Sep 24, 2026

Modulus vs. Remainder: Why -5 % 3 Isn’t the Same Everywhere
3 min
C
Python
R
Mathematics

Modulus and remainder agree for positive numbers but diverge for negative ones. A walkthrough of the truncated vs. floored division rules behind C, Python, and R’s % and %%…

Abdullah Al Mahmud
Sep 24, 2026

if-else in C, Python and R: Syntax Compared Side by Side
5 min
C
Python
R
Programming
Tutorial

The same if / else if / else written in C, Python and R, with a comparison table, the R ‘else on a new line’ trap, truthiness rules, and R’s vectorized ifelse().

Abdullah Al Mahmud
Sep 21, 2026

Compiling and Running C Programs on Linux: A Practical Workflow
6 min
Linux
C
Programming

Faster ways to compile and run C on Linux — one-liners, aliases, and Makefiles — plus the warning flags, debugging tools, and practice routine every beginner should adopt.

Abdullah Al Mahmud
Sep 20, 2026

The Probability of Having Four Babies of the Same Sex
3 min
statistics
probability

A binomial-distribution proof that a family of 4 children has exactly a 1-in-8 (12.5%) chance of all four being the same sex.

Abdullah Al Mahmud
Sep 16, 2026

Nested if in C, Explained with Real-Life Examples
5 min
C
Programming
Tutorial

What a nested if statement is in C, when the inner check runs, and two worked examples (a store discount and an ATM withdrawal) with flowcharts, code and common pitfalls.

Abdullah Al Mahmud
Sep 15, 2026

The Best Order to Write a Research Paper
3 min
research
writing

Why writing a paper top-to-bottom causes writer’s block, and the inside-out sequence experienced researchers use instead.

Abdullah Al Mahmud
Sep 11, 2026

Batch-Converting PDFs to Markdown with MarkItDown
2 min
Tools
Python
CLI

Microsoft’s MarkItDown CLI only converts one file at a time — here’s how to batch an entire folder of PDFs with a shell loop or a short Python script.

Abdullah Al Mahmud
Sep 11, 2026

Why Dispersion Matters as Much as Central Tendency
3 min
statistics
theory
dispersion

The mean or median only tells half the story — measures of spread like variance, standard deviation, and IQR reveal risk and consistency that averages hide.

Abdullah Al Mahmud
Sep 9, 2026

How to Recover a Frozen Linux Desktop
2 min
Linux
Troubleshooting

Two escalating fixes for a hung Linux graphical session, from restarting the display manager over TTY to a safe REISUB reboot.

Abdullah Al Mahmud
Sep 9, 2026

The Ultimate Guide to Making Fish Your Default Shell
3 min
CLI
Linux
Tutorial

How to install Fish and set it as your default shell on Ubuntu, Fedora, Arch, and Pop!_OS — including the terminal-profile workaround GNOME-based distros need.

Abdullah Al Mahmud
Sep 7, 2026

Reading Papers in the AI Age: A Hybrid Workflow
3 min
research
reading

Why the best strategy for reading research today isn’t AI summaries or full reads alone, but a 3-pass hybrid workflow that combines both.

Abdullah Al Mahmud
Sep 5, 2026

What’s New in qdraw: Shapes, Pages, and a Smarter Eraser
3 min
Tools
quarto

A tour of the latest qdraw features — a Quarto reveal.js extension for drawing and annotating directly on slides during a live presentation.

Abdullah Al Mahmud
Aug 29, 2026

Structs in C: Grouping Related Data (with Python and R Comparisons)
8 min
C
Programming
Tutorial

How C structs group different types into one unit: student records, arrays of structs, points, linked-list nodes, typedef, ->, padding, and how structs compare with Python…

Abdullah Al Mahmud
Aug 20, 2026

How to Run Python Inside RStudio with reticulate
3 min
R
Python
Tutorial

Set up RStudio to run Python code alongside R — configure the interpreter, install reticulate, and use three different workflows (scripts, mixed Quarto/R Markdown chunks…

Abdullah Al Mahmud
Aug 18, 2026

10 Real-World if / else Examples in C
5 min
C
Programming
Tutorial

Ten real-world C snippets, from grade calculators to ATM checks, each showing a different if/else pattern and when to use it.

Abdullah Al Mahmud
Aug 10, 2026

Why Use the Geometric Distribution?
2 min
probability
discrete distributions

The geometric distribution models the number of trials until the first success in independent Bernoulli trials. This post explains when and why to use it, with a real-world…

Abdullah Al Mahmud
Aug 5, 2026

C’s “Hello, World!” Explained Line by Line (for R & Python Users)
5 min
C
Programming
Tutorial

A line-by-line breakdown of the classic C Hello World program — what each part does, why C requires it, and how it compares to Python and R.

Abdullah Al Mahmud
Jul 21, 2026

The do-while Loop in C: Run First, Check After
4 min
C
Programming
Tutorial

How C’s do-while loop works: the body always runs at least once before the condition is tested. Two PIN-entry examples, plus do-while vs while and common pitfalls.

Abdullah Al Mahmud
Jul 16, 2026

How to Reset a Bootable USB Drive Using the Linux Command Line
2 min
Linux
Tutorial
CLI

A step-by-step guide to safely wiping a bootable Linux live USB and converting it back into a standard storage drive.

Abdullah Al Mahmud
Jun 2, 2026

How to Save Git Credentials on Windows, macOS, and Linux
2 min
Git
DevOps

A quick guide to configuring Git credential helpers so you never have to re-type your password or token.

Abdullah Al Mahmud
Jun 1, 2026

Understanding the Negative Binomial Distribution
4 min
probability
discrete distributions

The negative binomial distribution models the number of trials needed to achieve a fixed number of successes. This post explains its formulation, real-world applications…

Abdullah Al Mahmud
May 12, 2026

Be Impressive with Mathematics
1 min
Mathematics
recreational-math

A satirical note showing how (1+1=2) can be obscured using complex identities to appear more impressive for academic reviewers.

Abdullah Al Mahmud
Apr 23, 2026

SVM vs ANN: relative power, and usage guidelines
4 min
statistics
theory
ML
algorithm

Here’s a clear comparison of SVM vs ANN, their relative power, and usage guidelines.

Abdullah Al Mahmud
Jan 5, 2026

How to Make Git Ignore a Folder
1 min
Git
DevOps
Tutorial

Two ways to stop Git from tracking a folder — depending on whether it’s already been committed or not.

Abdullah Al Mahmud
Jan 5, 2026

Interaction Effect in Regression Analysis
3 min
statistics
theory
regression

An interaction effect means the effect of one variable on the outcome depends on the level of another variable.

Abdullah Al Mahmud
Nov 19, 2025

Z-score: What it is and what it does
3 min
statistics
theory
probability

A z-score (also known as a standard score or z-value) measures how many standard deviations a data point is from the mean of a distribution. It’s a way of…

Abdullah Al Mahmud
Nov 19, 2025

A/B Testing: A Sample Analysis
2 min
statistics
theory
business

A/B Testing– A Sample Analysis. Scenario– Testing a new button color.

Abdullah Al Mahmud
Nov 18, 2025

IQR in Statistics
2 min
statistics
theory
dispersion

The Interquartile Range (IQR) is a measure of statistical dispersion that describes the spread of the middle 50% of data.

Abdullah Al Mahmud
Nov 5, 2025

From t-test to Anova
7 min
statistics
theory
anova

Let’s build this step by step, starting from a t-test and then showing how it generalizes naturally into ANOVA (Analysis of Variance).

Abdullah Al Mahmud
Oct 10, 2025

ARIMA and SARIMA Time Series Models
4 min
statistics
time-series
R

A clear, concise explanation of ARIMA, SARIMA, and related models — followed by minimal R examples..

Abdullah Al Mahmud
Oct 6, 2025

Spatio-temporal Analysis Workflow
2 min
R
GIS

A learning roadmap for spatio-temporal analysis, from spatial statistics foundations to R/Python tooling, datasets, and open-source contribution paths.

Abdullah Al Mahmud
Sep 10, 2025

clockplot: Plot Event Times on a 24-Hour Clock
1 min
R
package

The announcement of the clockplot package.

Abdullah Al Mahmud
Aug 30, 2025

CRAN Package Submission Checklist
4 min
R
package

A comprehensive checklist for a smooth R package submission to CRAN.

Abdullah Al Mahmud
Aug 29, 2025

R Package Development Workflow
1 min
R
package

The Workflow that you may follow while developing your own R package.

Abdullah Al Mahmud
Aug 29, 2025

Interpretation of an Auto SARIMAX model output in R
3 min
statistics
time-series
R

A comprehensive explanation of AR (AutoRegressive) and MA (Moving Average) models and their parameters.

Abdullah Al Mahmud
Mar 16, 2024

AutoRegressive and Moving Average Time Series Models with R Code
3 min
statistics
time-series
R

A comprehensive explanation of AR (AutoRegressive) and MA (Moving Average) models and their parameters.

Abdullah Al Mahmud
Feb 23, 2024

SARIMAX Time Series Models with R Code
5 min
statistics
time-series
R

A clear, concise explanation of ARIMA, SARIMA, and related models — followed by minimal R examples..

Abdullah Al Mahmud
Jan 20, 2024
No matching items

    © 2026 Stat Mania

    • Tags

    • Categories

    • About

    • Portal

    • RSS