Python coding skills for statistic

Learning statistics is greatly facilitated by using a computational platform for doing statistics calculations and visualizations. You can do basic stats calculations using pen-and-paper for small datasets, but you’ll need a computer to help you with larger datasets. Common computational platforms for doing statistics include JASP, jamovi, SPSS, R, and Python, among many others. You can even do statistics calculations using spreadsheet software like Excel, LibreOffice calc, or Google Sheets. I believe using Python is the best computational platform for learning statistics. Specifically, an interactive notebook environment like JupyterLab provides the best-in-class tools for data visualizations and probability calculations.

But what about learners who are not familiar with Python? Should we abandon non-tech learners and say they can’t learn statistics because they don’t know how to use Python? Naaaah, we ain’t having none of that! Instead, my plan is to bring non-technical learners up to speed on Python by teaching them the Python basics that they need to use for statistics. Anyone can learn Python, it’s really not a big deal. I hope to convince you of this fact in this blog post, which is intended as a Python crash-course for the absolute beginner.

Continue reading “Python coding skills for statistic”

No Bullshit Guide to Statistics progress update

Over the years several readers have suggested (sometimes demanded!) that I write a book on statistics. Indeed, since the company’s mission is to make the most useful parts of math accessible to the people, it makes sense to pursue statistics as the next title. Statistics is some of the most useful math out there! The 21st century is going to be all about data, so it makes sense to learn about the concepts and tools you need to analyze data, discover patterns, and make decisions.

I’ve now been working on the No Bullshit Guide to Statistics for three years so I figured it’s about time for an update to let y’all know how it’s going. My goals with this blog post are to share with you the detailed book outline and chapter previews, and also ask for your help to validate certain assumptions about the readers’ background (math and programming skills) and their motivation to learn statistics. Please jump to the short survey before continuing with the rest of the blog post. It won’t take longer than 2 mins.


Continue reading “No Bullshit Guide to Statistics progress update”

Fixing the introductory statistics curriculum

Let’s talk about the problems with the teaching of statistics. Understanding statistics is essential for many fields of academic research, and also useful in industry. Why is it that first-year statistics courses sucks so bad? It seems that conceptual understanding of statistics ideas only marginally improve after taking a STATS 101 course. Is this because statistics is a really difficult subject to teach, or are we teaching it wrong?

I’ve been looking into this question for the last three years and I finally have a plan for how we can improve things. I’ll start wiht a summary of the statistics curriculum—the set of topics students are supposed to learn in STATS 101. I’ll list all the topics of the “classical” curriculum based on analytical approximations like the t-test. This is the approach currently taught in most high schools and universities around the world.

The “classical” curriculum has a number of problems with it. The main problem is that it’s based on difficult to understand concepts, and these concepts are often presented as procedures to follow without understanding the details. The classical curriculum is also very narrow, since it covers a slim subset of all the possible types of statistical analysis that can be described as math formulas that can be used blindly by plugging in the numbers. In the end of the introductory stats course, students know a few “recipes” for statistical analysis they can apply if they ever run into one of the few scenarios where the recipe can be used (comparison of two proportions, comparison of two means, etc.). That’s nice, but in practice this leaves learners totally unprepared to solve all stats problems that don’t fit the memorized templates, which is most of the problems they will need to solve in their day-to-day life. The current statistics curriculum is simply outdated (developed in times when the only computation available was simple algebraic formulas for computing test statistics and lookup tables for finding p-values). The focus on formulas and use of analytical approximations in the classical curriculum limits learners development of adjacent skills like programming and data management. Clearly there is room for improvement here, we can’t let the next generation of scientists, engineers, and business folks grow up without basic data literacy.

Something must be done.

Continue reading “Fixing the introductory statistics curriculum”

Improving the math chapter

The goal for the NO BULLSHIT guide to MATH & PHYSICS was to make a concise textbook that teaches university-level calculus and mechanics in a nice “combined package.” The math fundamentals chapter grew out of the need to introduce the prerequisite material that many students often lack. I didn’t want to be like “y’all should remember this math from high school,” because if you don’t remember the material such comments would not be very helpful. A review of high school math would be more helpful.

Continue reading “Improving the math chapter”

Learning can be fun

I just read this excellent article Pragmatic Learning: It’s not “fun” on Roger Schank’s blog. It’s a very good post that calls bullshit on the “gamification” cargo cult which is widespread in the edtech and corporate training world. Just adding points, badges, and levels to a corporate training program that teaches you something boring is not going to suddenly make it fun. The author’s main observation is that forced learning is not fun and we need not pretend it is. Consider an employer who wants their employees to know X because it is required by law, or a bunch of students forced to learn Y or else they’ll fail. These “forced” trainings are not fun, and gamifying them is akin to putting lipstick on a pig.

Continue reading “Learning can be fun”


Calculus and mechanics are often taught as separate subjects. It shouldn’t be like that. If you learn calculus without mechanics, it will be boring. If you learn physics without calculus, you won’t truly understand.

I think I may have found a way to solve this chicken and egg problem. It goes a little something like this:

  1. Chapter 1. You need [solving_equations,algebra,quadratic_equation] to do physics. That is all the prerequisites for first year Physics.
  2. Chapter 2. Physics laws are expressed as equations. If you know how to solve equations, then you know how to solve physics equations. In particular we will study the kinematics equations $x(t)$, $v(t)$, $a(t)$, which describe the motion of an object.
    • Start by defining kinematics concepts like time $t$, position $x(t)$, velocity $v(t)$, acceleration $a(t)$, initial position $x_i$, and initial velocity $v_i$. We can then state the UAM equations straight up: $a(t)=a$, $v(t)=v_i+at$, $x(t)=x_i+v_it+\frac{1}{2}at^2$. Example (free fall): An object on which only the force of gravity acts is said to be in free fall. Such objects experience a constant downwards acceleration of magnitude 9.81[$m/s^2$].  The classic examples are a ball thrown in the air. Using equations you can calculate the trajectory of the ball, and predict where it will land. Equations are cool and all, but where do these equations come from?In order to find out we must take a short excursion into calculus-land.
    • Calculus is the study of functions. We use calculus in to describe how quantities change over time (derivatives \(f'(t)\)) or to find the total amount of quantities that vary over time (integration \(F = \int f \;dt\)). Integrals sound fancy, but are really just a an area-under-the-curve calculation. Provide visual proofs for two important cases: if $f(t)=3$, then $F(t)=3t$. If $g(t)=t$, the integral is $G(t)=\frac{1}{2}t^2$.But why should anyone care about integrals?  What good is computing the area under a curve?
    • Integrals are the inverse operation of the derivative. In analogy with the inverse functions that we use when solving equations, the concept of an inverse operation is a useful concept in calculus: integrals are the inverse operations of derivatives.The kinematics equations of that describe the motion of objects can be derived from Newton’s law $F=ma$ and applying the integration operation twice. This is easy to see: we start by rewriting $F=ma(t)$ as $F=mx”(t)$, which means the force on an object is equal to the second derivative of $x(t)$. Recall that we just learned that integrals are the inverse operation of derivatives, so if we want to solve for $x(t)$ in $F=mx”(t)$ we can do it! First we divide both sides by m, in order to isolate the x expression on the right $F/m = x”(t)$. Then apply the integration operation twice in order to undo the two derivative operations.In particular, let us consider the case when $F=\textrm{const.}$ which implies that  then $a(t)=\textrm{const.}=a$. The equation we want to solve is $F/m = a=x”(t)$. Applying the integration operation to both sides of this equation we get $at+C=x'(t)$. By definition $x'(t)=v(t)$ so the constant $C$ can be identified as the initial velocity $v(0)=v_i$. Applying the integration operation to both sides a second time gives us $\frac{1}{2}at^2 + v_it + x_i = x(t)$. This is how the UAM equations are derived: $F=ma$ and 2x integration steps.
    • Main idea of this book: understand the math + physics is easier than just learning physics by memorizing the equations. With memorization, you would need to remember three equations of motion as separate entities. If you understand derivatives and integrals then you can remember just one equation $a(t)=a$, which is not much to remember since it is in the name UAM.
    • We have now seen kinematics in one dimension. But the real world is three dimensional so we need to learn about the math for dealing with objects in 3D.
  3. Chapter 3: Vectors.
  4. Chapter 4: Now that we know about vectors we can discuss more physics (mechanics).
    • Projectile motion. The position of the object is now a vector $\vec{r}(t)=[x(t),y(t)]$. There are two separate sets of kinematics equations. $x(t)$ is UVM (since no forces in the hz direction) while y(t) is UAM ($a_y=-9.81$ due to the force of gravity).
    • Introduce dynamics $\vec{F}=m\vec{a}$, i.e. forces cause acceleration. Forces. Force diagrams.
    • Momentum.
    • Energy.
    • Uniform circular motion.
    • Angular motion.
    • SHM.


The structure in Chapter 2 is the only new thing. After that, Chapter 4 is pretty much a standard course through the mechanics curriculum. So how is Chapter 2 so special, as to be worth blogging about at 2:44 in the morning?

I will tell you in point form, because it is kind of late indeed:

  • It connects nicely with the Precalculus chapter. You just learned how to solve equations for 50 pages, and now I am telling you that you can do physics with this equation solving skill. Yey! Math is useful.
  • Then we introduce a bit of basic kinematics concepts $x$, $v$, $a$ and the equations of motion. But then we say where did these equations come from (this is kind of a weak point?). To tell you, we must learn Calculus.
  • Bam—drette là—we do a mini course on calculus in 5 pages. Integrals with pictures and FTC. Sure it is complicated but the analogy to f and f-inverse should make it go through.
  • Then show derivation of $x(t)$ via int( int($F/m$) ). I can use the exact integral formula since students just saw those formulas as pictures 4 pages ago so they can’t say “i don’t know integrals”.
  • Having this early exposure to integrals also helps with the work and potential energy section later on in Chapter 4.
  • Basically the 5-page mini introduction to integral calculus is sufficient to do calculus-based mechanics course. The sin/cos derivative info and the chain rule required for deriving the SHM is presented in a just-in-time manner (i.e. in the last chapter).

But who am-I to say what is and isn’t a good way to teach. Only the students can tell me.


Update May 2021: I improved the formatting of the equations in the blog post and added links to the current version of the MATH & PHYS book preview.