{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Tutorial A2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__1__ Consider the equation $y = \\frac{3a + 2b}{b^2}$, with $a = 1$ and $b = 2$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - Calculate $y$ using Python." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - Of what type is the result?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - How can you force the result to be a whole number?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - Of what type is the result if $b = 1$?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - What happens if $b = 0$?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__2__ Calculate the gravitational force between the moon and the earth at a distance of $r = 3.84\\times 10^8$ m, with masses $m_\\mathrm{earth} = 5.97\\times 10^{24}$ kg, $m_\\mathrm{moon} = 7.35\\times 10^{22}$ kg. Use $G = 6.67 \\times 10^{-11}$ m$^3$ kg$^{-1}$ s$^{-2}$ for the gravitational constant." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Advanced 1__ How does Python handle infinity and absent numeric values? What is\n", "the result of a multiplication of these values with 0?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "