Skip to content
Yantra Blog
Menu
  • Home
  • About me
  • Blog Home
Menu

What is Null and Alternative Hypothesis

Posted on December 12, 2023March 9, 2024 by Mrukant Popat
Patient number 1 doing exercise number 1 after knee replacement surgery. Example for what is null and alternative hypothesis


Null and Alternative Hypothesis is used extensively in Machine Learning. Before we answer what is null and alternative hypothesis, let us understand what is Hypothesis Testing.

Hypothesis Testing is used to assess if the difference between samples taken from population are representative of actual difference between populations themselves. 

Now why do we even conduct hypothesis testing? Suppose we are comparing the efficacy between two different exercises on 10 patients who underwent the same kind and complexity of knee replacement surgery. This should not be too difficult to do with real data. E.g. 5 patients are asked to do exercise1 and other 5 are asked to do exercise 2,  15 mins a day for 1 month after surgery. After a month, they are tested for the angle at which they can bend their knee. This comparison between patients is not difficult to make.

Now let us imagine if the same comparison is between two groups of patients from two different hospitals. The comparison quickly becomes unwieldy and introduces multiple random events which can easily affect the data. E.g. some patients do exercise after a shower, or after food, or some patients were on different medication which affected their musculoskeletal system etc. Now imagine if the comparison is not across these two groups, but across the population of the whole state of California. Here it is extremely difficult, if not impossible, to compare every single patient in the state of California. Lets park this thought for a second.

Now what is Null Hypothesis (H0):

Null hypothesis H0 is also described as “no difference” hypothesis. i.e. There is no difference between sample sets from different populations. Here we mostly see an equality relationship.

So for the example above about sample of patients from state of California, we start by assuming that null hypothesis H0 is true. i.e. all the samples from different population set are same and that there is no difference between them. We then calculate the probability of such an event (occurrence of null-hypothesis) using the a number between 0 and 1 called as p-value. Generally a value less than 0.05 is considered low probability and therefore we say that chance of having null-hypothesis is very less. Thus we reject null-hypothesis in that scenario. For a p-value greater than 0.05 we fail to reject null-hypothesis (Basically a roundabout way of saying that null-hypothesis is true). For p<0.05, when null-hypothesis is rejected, an alternative hypothesis must be adopted in its place.

What is Alternative Hypothesis (Ha) :

Alternative hypothesis is a scenario in which if you have a new claim against the default hypothesis using current data and therefore it is sort of a new news and requires data to back up this claim. You basically say that you disagree with the data at hand and that there is something new happening. The alternative hypothesis does not have a statement of equality and also uses data from pre-established success rate given in the problem statement.

In the above example of efficacy of exercise comparison for patients, a p-value < 0.05 will reject null-hypothesis and thus an alternative hypothesis takes place. From hereon, we get an opportunity to dig more deeper into the available data and see how the sample sets are different ( Remember, if null-hypothesis was true then we would have concluded that sample data are all the same and that both exercises help patients equally. Only after p-value being less than 0.05 we rejected null-hypothesis ) . We can use various statistical calculations e.g. mean angle of knee bent amongst people of exercise1 set vs mean angle of knee bent amongst people of exercise2 set. This may help us determine which exercise turned out to be better.

Patient number 2 doing exercise number 2 after knee replacement surgery. Example for what is null and alternative hypothesis


Why do we use null-hypothesis? 

Null-hypothesis seems to be an extremely simple way to start. And that is exactly what we want in statistical inference. A starting point. Null hypothesis provides an easy starting point. It is easy to describe our expectation from data when null hypothesis exist. An then by using p-value we land on to alternative hypothesis, if it is available or inferred using the data. Null and alternative hypothesis are mutually exclusive.

Bibliography:

  • Walker J. (2019). Hypothesis tests. BJA education, 19(7), 227–231.
    https://doi.org/10.1016/j.bjae.2019.03.006
  • Khan S., “Simple Hypothesis Testing” (video). Khan Academy. Accessed December 11, 2023. http://www.khanacademy.org/math/statistics-probability/significance-tests-one-sample/idea-of-significance-tests/v/simple-hypothesis-testing
  • Starmer J., “Hypothesis Testing and The Null Hypothesis, Clearly Explained!!!” (video). StatQuest. Accessed December 11, 2023. https://youtu.be/0oc49DyA3hU?si=o5IO4WcSVGUy7E6g
Category: Machine Learning

Post navigation

← Supervised Machine Learning for Beginners
Types of IPv6 addresses →

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Robot Economics: When Do Robots Beat Humans? ROI GuideMay 5, 2026
  • 🚀 NVIDIA Vera Rubin Superchip: From GTC 2026 to AI FactoriesMarch 23, 2026
  • Media security, transport, decode and renderFebruary 25, 2026
  • NVIDIA GPU Deep Dive : Tensor and Ray Tracing CoresMay 8, 2025
  • Deep Dive into GPU Compute HierarchyMay 1, 2025
  • ✅ Introduction to NVIDIA GPU Architecture: Hierarchy, Cores, and ParallelismApril 22, 2025
  • 🔄 Google’s Agent2Agent (A2A) Protocol: A New Era of AI Agent InteroperabilityApril 9, 2025
  • Timeline from Transformers to LLMs and Agentic AIMarch 11, 2025
  • A Deep Dive into PyTorch’s GPU Memory ManagementSeptember 3, 2024
  • 🚀 The Evolution of YOLO 🚀August 27, 2024
  • Basic Machine Learning Optimization AlgorithmsJuly 6, 2024
  • Hand written notes on Neural Networks and ML course by Andrew NgJune 25, 2024
  • How to Compile Linux kernelApril 4, 2024
  • Rust Programming Language learning roadmapMarch 26, 2024
  • BERYL – new breakthrough Acoustic Echo Cancellation by MetaMarch 22, 2024
  • Demystifying WebRTCMarch 21, 2024
  • How to succeed at workMarch 7, 2024
  • NTP – Network Time ProtocolMarch 6, 2024
  • My car has a digital twin !February 26, 2024
  • How to (or not to) hireFebruary 21, 2024
  • IPv6 – NDP, SLAAC and static routingFebruary 20, 2024
  • Types of IPv6 addressesFebruary 15, 2024
  • What is Null and Alternative HypothesisDecember 12, 2023
  • Supervised Machine Learning for BeginnersNovember 24, 2023
© 2026 Yantra Blog | Powered by Minimalist Blog WordPress Theme