**What is Confidence Intervals?**

The confidence interval is a range of intervals that are likely to include the values from the population with a certain degree of confidence. It often lies between two upper and the lower interval and expressed in the percentage.**How to find confidence intervals?****Step 1: **As a first step subtract 1 from the sample size. It is considered as the degree of freedom.**Step 2:** Subtract the given confidence level from 1 and divide by 2.**Step 3**: Using the values from step 1 and step 2 predict the value from the t-distribution table.**Step 4**: Samples standard deviation should be divided by the square root of the sample size.**Step 5**: Multiply the value obtained from step 3 and step 4**Step 6**: For the lower end subtract the step 5 value from the mean.**Step 7**: For the upper range add the step 5 value to mean.

From the steps, you can understand that the confidence interval depends on the 3 values,

- The standard error of measurements
- Degree of freedom
- The value obtained from the distribution table.

**Confidence Intervals and Hypothesis Testing**

There is often a good relationship between the confidence interval and the hypothesis testing. If the null hypothesis H_{0 }is rejected in some significance level α then the confidence interval does not contain the value µ_{0 }in the hypothesis_{ }at the confidence level of (1-α).**Duality with Confidence Intervals**

Below are the examples to demonstrate the relationship between the confidence intervals and the hypothesis testing.

**Example 1:**

Given: There exists the 95% confidence that the sample mean value lies between 121 and 130.

Null hypothesis: The mean value is 123

Alternate Hypothesis: The mean value is not equal to 123

Since the mean value 123 lies within the confidence interval, the null hypothesis cannot be rejected.**Example 2**

For the same above example let us consider the mean value to be 131.In such cases,

Null Hypothesis: The mean value is 131.

Alternate Hypothesis: The mean value is not equal to 131.

The null hypothesis is rejected because the mean value 131 does not lie within the confidence interval.**Relationship between Confidence level and the Significance level for Hypothesis Testing**

Confidence Level = 1 – Significance Level.

For example, if the significance level is 0.05 then the confidence level is,

Confidence Level = 1-0.05 = 0.95 = 95%

Now the Confidence level is known and the hypothesis can be tested.**Prediction Based on the P-value**

In many cases where the given P-value is less than the α (Significance level), then the confidence interval will not have the value mentioned in the null hypothesis, so the test is significant.**Reference**

https://www.mathsisfun.com/data/confidence-interval.html

https://www.austincc.edu/mparker/1342/dl_sp10_pes_sr/dl_09/ch11-17/ht/hyp_conf.htm

https://www.statisticshowto.com/probability-and-statistics/confidence-interval/