#!/usr/bin/env python # coding: utf-8 # **Note**: Click on "*Kernel*" > "*Restart Kernel and Clear All Outputs*" in [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) *before* reading this notebook to reset its output. If you cannot run this file on your machine, you may want to open it [in the cloud ](https://mybinder.org/v2/gh/webartifex/intro-to-python/main?urlpath=lab/tree/05_numbers/06_resources.ipynb). # # Chapter 5: Numbers & Bits (Further Resources) # ## Working with Bits # The two videos below show how addition and multiplication works with numbers in their binary representations. Subtraction is a bit more involved as we need to understand how negative numbers are represented in binary with the concept of [Two's Complement ](https://en.wikipedia.org/wiki/Two%27s_complement) first. A video on that is shown further below. Division in binary is actually also quite simple. # In[1]: from IPython.display import YouTubeVideo YouTubeVideo("RgklPQ8rbkg", width="60%") # In[2]: YouTubeVideo("xHWKYFhhtJQ", width="60%") # The video below explains the idea behind [Two's Complement ](https://en.wikipedia.org/wiki/Two%27s_complement). This is how most modern programming languages implement negative integers. The video also shows how subtraction in binary works. # In[3]: YouTubeVideo("4qH4unVtJkE", width="60%") # ## The Intuition behind Floating Point Numbers # This video by the YouTube channel [Computerphile](https://www.youtube.com/channel/UC9-y-6csu5WGm29I7JiwpnA) explains floating point numbers in an intuitive way with some numeric examples. # In[4]: YouTubeVideo("PZRI1IfStY0", width="60%") # ## An Introduction to Complex Numbers # Below is a short introduction to [complex numbers ](https://en.wikipedia.org/wiki/Complex_number) by [MIT](https://www.mit.edu) professor [Gilbert Strang ](https://en.wikipedia.org/wiki/Gilbert_Strang) aimed at high school students. # In[5]: YouTubeVideo("Jkv-55ndVYY", width="60%")