{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(Click **Cell** > **Run All** before proceeding.)"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"tags": [
"hide-input"
]
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"\n",
"#----------\n",
"\n",
"#Import modules and packages \n",
"import ipywidgets as widgets\n",
"import random\n",
"import math\n",
"import matplotlib.pyplot as plt\n",
"from ipywidgets import Output, IntSlider, VBox, HBox, Layout\n",
"from IPython.display import clear_output, display, HTML, Javascript, SVG, YouTubeVideo\n",
"\n",
"#----------\n",
"\n",
"#ipywidgets as widgets\n",
"#import random\n",
"\n",
"#This function produces a multiple choice form with four options\n",
"def multiple_choice(option_1, option_2, option_3, option_4):\n",
" option_list = [option_1, option_2, option_3, option_4]\n",
" answer = option_list[0]\n",
" letters = [\"(A) \", \"(B) \", \"(C) \", \"(D) \"]\n",
"\n",
" #Boldface letters at the beginning of each option\n",
" start_bold = \"\\033[1m\"; end_bold = \"\\033[0;0m\"\n",
"\n",
" #Randomly shuffle the options\n",
" random.shuffle(option_list)\n",
" \n",
" #Prints the letters (A) to (D) in sequence with randomly chosen options\n",
" for i in range(4):\n",
" option_text = option_list.pop()\n",
" print(start_bold + letters[i] + end_bold + option_text)\n",
"\n",
" #Stores the correct answer\n",
" if option_text == answer:\n",
" letter_answer = letters[i]\n",
"\n",
" button1 = widgets.Button(description=\"(A)\"); button2 = widgets.Button(description=\"(B)\")\n",
" button3 = widgets.Button(description=\"(C)\"); button4 = widgets.Button(description=\"(D)\")\n",
" \n",
" button1.style.button_color = 'Whitesmoke'; button2.style.button_color = 'Whitesmoke'\n",
" button3.style.button_color = 'Whitesmoke'; button4.style.button_color = 'Whitesmoke'\n",
" \n",
" container = widgets.HBox(children=[button1,button2,button3,button4])\n",
" display(container)\n",
" print(\" \", end='\\r')\n",
"\n",
" def on_button1_clicked(b):\n",
" if \"(A) \" == letter_answer:\n",
" print(\"Correct! 👏\", end='\\r')\n",
" button1.style.button_color = '#abffa8'; button2.style.button_color = 'Whitesmoke'\n",
" button3.style.button_color = 'Whitesmoke'; button4.style.button_color = 'Whitesmoke'\n",
" else:\n",
" print(\"Try again! \", end='\\r')\n",
" button1.style.button_color = '#ffbbb8'; button2.style.button_color = 'Whitesmoke'\n",
" button3.style.button_color = 'Whitesmoke'; button4.style.button_color = 'Whitesmoke'\n",
"\n",
" def on_button2_clicked(b):\n",
" if \"(B) \" == letter_answer:\n",
" print(\"Correct! 👏\", end='\\r')\n",
" button1.style.button_color = 'Whitesmoke'; button2.style.button_color = '#abffa8'\n",
" button3.style.button_color = 'Whitesmoke'; button4.style.button_color = 'Whitesmoke'\n",
" else:\n",
" print(\"Try again! \", end='\\r')\n",
" button1.style.button_color = 'Whitesmoke'; button2.style.button_color = '#ffbbb8'\n",
" button3.style.button_color = 'Whitesmoke'; button4.style.button_color = 'Whitesmoke'\n",
"\n",
" def on_button3_clicked(b):\n",
" if \"(C) \" == letter_answer:\n",
" print(\"Correct! 👏\", end='\\r')\n",
" button1.style.button_color = 'Whitesmoke'; button2.style.button_color = 'Whitesmoke'\n",
" button3.style.button_color = '#abffa8'; button4.style.button_color = 'Whitesmoke'\n",
" else:\n",
" print(\"Try again! \", end='\\r')\n",
" button1.style.button_color = 'Whitesmoke'; button2.style.button_color = 'Whitesmoke'\n",
" button3.style.button_color = '#ffbbb8'; button4.style.button_color = 'Whitesmoke'\n",
"\n",
" def on_button4_clicked(b):\n",
" if \"(D) \" == letter_answer:\n",
" print(\"Correct! 👏\", end='\\r')\n",
" button1.style.button_color = 'Whitesmoke'; button2.style.button_color = 'Whitesmoke'\n",
" button3.style.button_color = 'Whitesmoke'; button4.style.button_color = '#abffa8'\n",
" else:\n",
" print(\"Try again! \", end='\\r')\n",
" button1.style.button_color = 'Whitesmoke'; button2.style.button_color = 'Whitesmoke'\n",
" button3.style.button_color = 'Whitesmoke'; button4.style.button_color = '#ffbbb8'\n",
"\n",
" button1.on_click(on_button1_clicked); button2.on_click(on_button2_clicked)\n",
" button3.on_click(on_button3_clicked); button4.on_click(on_button4_clicked)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Stoichiometry and Limiting Reactants\n",
"\n",
"
\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Stoichiometry\n",
"\n",
"**Stoichiometry** is founded on the Law of Conservation of Mass. Note that \"stoichio\" comes from the Greek word \"stoikheion\" which means \"element\" and \"metry\" means \"measure\". So \"stoichiometry\" is the calculation of relative quantities of reactants and products in chemical reactions.\n",
"\n",
"**Stoichiometry allows us to:**\n",
"\n",
"- Predict how much product will form in chemical reactions.\n",
"- Determine which reactant is in excess and which is limiting."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Mole - Mole Relationships in Chemical Reactions\n",
"\n",
"The coefficients in a balanced chemical equation indicate both the relative numbers of molecules in the reaction and the relative number of moles.\n",
"\n",
"
\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Examples\n",
"\n",
"**1)** Consider the following chemical equation: \n",
"\n",
"