Skip to content
/ FtoC Public

Fahrenheit to Celsius conversion analysis, comparing accurate and approximate methods with visualizations and error analysis.

Notifications You must be signed in to change notification settings

ALZ-11/FtoC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

Fahrenheit to Celsius Conversion: Accurate vs. Approximate

Welcome to the Fahrenheit to Celsius Conversion mini-project. In this repo, we compare two methods for converting Fahrenheit to Celsius:

  1. The Accurate Formula: $C = \frac{5}{9} \times (F - 32) $
  2. The Approximate Formula: $C \approx \frac{1}{2} \times (F - 32) $

We dive into how the approximation performs compared to the accurate conversion, and how the error behaves at specific Fahrenheit values.

Key Features

  • Accurate vs. Approximate Conversion: Understand the difference and where the approximation works best.
  • Error Analysis: Visualize the error pattern between both methods.
  • Insight: Discover the unexpected regularity in the error increments.

The Math (Just the Essentials)

Accurate Formula:

The accurate conversion from Fahrenheit to Celsius is: $C = \frac{5}{9} \times (F - 32)$

Approximate Formula:

A simplified method is: $C \approx \frac{1}{2} \times (F - 32)$

Absolute Error:

We calculate the absolute error between both methods: $\text{Absolute Error} = \left| \frac{5}{9} (F - 32) - \frac{1}{2} (F - 32) \right|$

This error increases predictably at specific Fahrenheit values, especially every $36°F $ from the focal point of $32°F$. For example, at $68°F$, $104°F$, and so on, the error increments in $2°C$ steps.

Interactive Graphs

  • Graphs comparing the results of both conversion methods.
  • Error graphs highlighting key points where the error increases by $2°C$ every $36°F$ from 32°F.

These plots give us a visual insight into the regularity of the error and how far apart the two methods diverge.

Fact

The error increments by $2°C$ at $36°F$ intervals from the focal point of $32°F$. This means you can use mental math to make small adjustments to your conversion when approximating the Celsius value.

Example:

  • At $68°F$, add $2°C$.
  • At $104°F$, add $4°C$.

Getting Started

Prerequisites:

  • Python 3.x
  • Jupyter Notebook (or any compatible environment)
  • NumPy, Matplotlib

Install the dependencies with:

pip install numpy matplotlib

Running the Notebook:

  1. Clone the repo:
    git clone https://github.com/ALZ-11/FtoC.git
  2. Navigate into the directory:
    cd FtoC
  3. Launch the notebook:
    jupyter notebook mainFtoC.ipynb

Once the notebook is open, you'll find a step-by-step walkthrough that includes analysis and visualisations. The visual elements will make it easy to see the mathematical relationships at play.

How to Contribute

If you have suggestions or want to improve this project, here's how you can help:

  • Fork the repository and submit a pull request! I welcome fixes, enhancements, or new features.
  • Share your own improvements to the visualizations or error analysis for an even better understanding of the conversion process.

Tip: For a more interactive experience, consider adding your own graphs, analysis, or improving the layout.

Feel free to dive into the notebook and explore all the interesting patterns of Fahrenheit to Celsius conversion!

Releases

No releases published

Packages

No packages published