<commit_before><!doctype html>
<html>
  <head>
    <title>Introduction to Chemistry</title>
    <style>
table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 15px;
}
.ce {
  font-size: x-large;
}
    </style>
  </head>
  <body>

    <h1>Introduction to Chemistry</h1>

    <h2>Introduction</h2>

    <p>This is a brief introduction to chemistry. It is like a summary, or "cheat sheet". It includes a small introduction
to organic chemistry.</p>

    <p>This summary is primarily based on the material in <a href="https://chem.libretexts.org/Bookshelves/Introductory_Chemistry/Book%3A_Beginning_Chemistry_(Ball)">Beginning Chemistry</a>.</p>

    <p>It is handy to always have a browser tab open with the <a href="https://www.rsc.org/periodic-table" target="_blank">Periodic Table</a>.</p>

    <h2>Atoms</h2>

    <p><em>Matter</em> is anything that has mass and takes up space. A <em>substance</em> is matter that has the same physical
and chemical properties throughout.</p>

    <p>An <em>element</em> is a substance that cannot be broken down into simpler chemical substances by ordinary
chemical means.</p>

    <p>The smallest piece of an element that maintains the identity of the element is called an <em>atom</em>. Hence all
matter is made from atoms.</p>

    <p>Each atom contains:</p>
    <ul>
      <li>A compact <em>nucleus</em> containing:</li>
        <ul>
          <li><em>Protons</em>. They are positively charged (1+), and weigh about 1.6e<sup>-27</sup> kg.</li>
          <li><em>Neutrons</em>. They are uncharged, and weigh about the same as protons (slightly more).</li>
        </ul>
      <li><em>Electrons</em>. They are negatively charged (1-), and weigh only about 9.1e<sup>-31</sup> kg.
These electrons circle around the nucleus at a relatively large distance from it.</li>
    </ul>

    <p>If the atom is uncharged, it has the same number of protons as electrons.</p>

    <h2>Periodic Table</h2>

    <p>All known elements occur in the <em>periodic table</em>, in a purposely chosen layout. For each element, the following
data (and more) is found in the periodic table:</p>
    <ul>
      <li>Name of the element. E.g. Hydrogen, Helium, Carbon, Oxygen, Silver.</li>
      <li><em>Element symbol</em>. E.g. (corresponding with the names above) H, He, C, O, Ag.</li>
      <li><em>Atomic number</em>. This is the number of protons, and uniquely identifies the element.</li>
      <li>Key <em>isotopes</em>. While the number of protons is fixed, the number of neutrons can vary for one element,
thus leading to different isotopes. E.g. <sup>12</sup>C, <sup>13</sup>C, <sup>14</sup>C.</li>
      <li><em>Atomic mass</em>. This is the (average) sum of the number of protons and neutrons. Given that there can be multiple
isotopes (some abundantly available, some rare), this is typically not a whole number, but it is a weighted average.</li>
      <li>Density, in g/cm<sup>3</sup>.</li>
      <li>Other physical properties like state at room temperature, melting point, boiling point.</li>
      <li>Uses and properties, history.</li>
    </ul>

    <p>An <em>atomic mass unit</em> (<em>u</em>) is approximately the mass of 1 proton or neutron. More precisely, an
atomic mass unit is one-twelfth of the mass of a carbon-12 atom, which is a carbon isotope having 6 protons and 6 neutrons. The
<em>mass number</em> of an isotope of an element is the exact number of protons plus the exact number of neutrons (which
clearly is a whole number for the isotope). Given that isotopes of an element occur in a given ratio, the <em>atomic mass</em>
of an element is the weighted average mass number for that element.</p>

    <p>There is more interesting data in the periodic table, but for that we need to know more about electron configurations.
In a quantum-mechanical model of an atom, the state of an electron is described by 4 <em>quantum numbers</em>:</p>
    <ul>
      <li><em>Principal quantum number</em>, or <em>n</em>. It identifies the <em>shell</em>, which can be thought of as the
distance to the nucleus. It is a non-zero whole number: 1, 2 or higher. The higher the number, the further the shell is from
the nucleus, and the more energy the electrons in that shell have.</li>
      <li><em>Angular momentum quantum number</em>, or <em>l</em>. It identifies the <em>subshell</em> within a shell.
It is any number between 0 and <em>n - 1</em>.</li>
      <li><em>Magnetic quantum number</em>, or <em>m<sub>l</sub></em>. It is any integer between <em>-l</em> and <em>l</em>.</li>
      <li><em>Spin quantum number</em>. It is either <em>1/2</em> or <em>-1/2</em>.</li>
    </ul>

    <p>The <em>Pauli exclusion principle</em> states that no 2 electrons in an atom can have the same set of 4 quantum numbers.
Keep that in mind below, when talking about electron configurations. Note that for subshell <em>l</em> (in a given shell)
there can be <code>2 * l + 1</code> different magnetic quantum numbers, so <code> 2 * (2 * l + 1)</code> electrons
(taking the 2 different spin quantum numbers in mind).</p>

    <p>The quantum numbers lead to the <em>electron configuration</em> of an element in the periodic table. First give the
subshells a letter instead of number, namely <em>s</em>, <em>p</em>, <em>d</em> and <em>f</em> for subshell 0, 1, 2 and 3,
respectively. Remember this as <em>SPeeD, Fine</em>, for example. The electron configuration repeats the pattern
shell-subshell-(electron-count). For example:</p>
    <ul>
      <li><em>1s<sup>1</sup></em> for H. That is: shell 1, subshell s (or 0), and 1 electron in that subshell.</li>
      <li><em>1s<sup>2</sup></em> for He. That is: shell 1, subshell s (or 0), and 2 electrons in that subshell, which is the
maximum number of electrons in any <em>s</em> subshell.</li>
      <li><em>[He]2s<sup>2</sup>2p<sup>2</sup></em> for C. Note that [He] stands for <em>1s<sup>2</sup></em>, but there is no
need to repeat that (which will become clear later). Also note that for increasing atomic numbers first the lower level shells
are filled, roughly, and that per subshell the order is roughly s-p-d-f when "filling electrons".</li>
      <li><em>[Xe]4f<sup>14</sup>5d<sup>10</sup>6s<sup>1</sup></em> for Au (gold). All subshells but the last are completely
filled.</li>
    </ul>

    <p>Note that for uncharged atoms, the number of electrons and protons are the same, which makes sense because protons
and electrons have the opposite charge (1 and -1, respectively). Hence, the number of electrons is the same as the atomic
number. Note that the number of electrons also easily follows from the electron configuration.</p>

    <p>Also note that electrons start to fill the "lowest energy positions" that are not filled. This is clearly visible in the
periodic table, for increasing atomic numbers.</p>

    <p>The electron configuration of an element tells us a lot about reactivity. When shells and subshells are completely filled,
the atom is so stable that it hardly reacts, if at all. That's the case for <em>noble gases</em>, like He, Ne, Ar, Kr and Xe.
The <em>octet rule</em> says that atoms like to have 8 electrons in their valence shell. More about that (and exceptions)
later.</p>

    <p>For each element, the highest numbered shell is called the <em>valence shell</em>. The electrons in the valence shell,
plus the electrons in the last unfilled subshell are called <em>valence electrons</em> (but beware of double counting). Elements
with similar electron configuration in their valence shells have similar chemistry. This is represented in the periodic table
by elements having the same column. For example, the noble gases all have fully filled shells and subshells, and they are all
found in the rightmost column.</p>

    <p>One trend in the periodic table is that the <em>atomic radius</em> goes up if we go down in one column (group), but
goes down if we go to the right in one row (period). The reasons are: going down in one group means an extra shell, increasing
the atomic radius, but going to the right in one period means more protons and therefore more positive charge attracting
the valence electrons.</p>

    <p>The <em>ionization energy</em> is the amount of energy required to remove an electron from an atom in the gas phase.
Going down in the periodic table means decreasing ionization energy, because the valence electron is further away from the
nucleus, due to it being in a higher numbered shell. Going to the right in the periodic table means increasing ionization
energy, due to the increasing pull on the electrons by the increasing number of protons.</p>

    <p>There is more than one IE (ionization energy), for removing successive electrons (if the atom has them).
These successive IE's increase, due to the larger net positive charge.</p>

    <p>The opposite of IE is <em>electron affinity</em> (EA). That is the energy change when a gas-phase atom accepts an
electron. The general trend (in kJ/mol) is obvious, but there is no definitive trend.</p>

    <p><em>Electronegativity</em> is a qualitative scale for judging how much an atom of a given element attracts electrons to
itself in a chemical bond. Electronegativity (Pauling scale) is the highest for fluorine, that is the top right corner of the
periodic table with the exception of the noble gas group (at the last column). It is the lowest at the botton left corner.
Obviously, due to the octet rule, halogens (in the column directly left of the noble gases) have high electronegativity.
These elements "want to attract" an electron to fully fill their valence shell with 8 instead of 7 electrons. Indeed,
going from left to right in the periodic table tends to increase the electronegativity. In left columns, the metals there
want to shed electrons rather than attract them, according to the octet rule. When going down, electronegativity decreases,
which makes sense in that valence electrons are further away from the positively charged nucleus.</p>

    <p>Strictly, electronegativity is a property of an atom within a molecule, rather than an inherent property of an atom.</p>

    <p>TODO Groups of elements (halogens, metals, noble gases, etc.)</p>

    <h2>Molecules, Ions and Ionic Compounds</h2>

    <p>A <em>molecule</em> is the smallest part of a substance that has the physical and chemical properties of that substance.
They combine atoms in whole-number ratios. Molecules have no charge, and their atoms are bound by <em>covalent</em> bonds.
That is, their atoms <em>share electrons</em>, instead of one atom stealing the other atom's electrons (which would instead
lead to ionic compounds).</p>

    <p>There are 2 kinds of molecules:</p>
    <ul>
      <li><em>Single-element molecules</em>, or element molecules, or molecular elements.</li>
      <li><em>Molecular compounds</em> (being compounds implies that more than 1 element is involved).
More precisely, a molecular compound combines 2 or more nonmetals.</li>
    </ul>

    <p>Some elements exist naturally as molecules (2-atom or having more than 2 atoms), for example H<sub>2</sub>,
O<sub>2</sub>, P<sub>4</sub> and S<sub>8</sub>.</p>

    <p>Molecules (with a given <em>molecular formula</em>) have a <em>molecular mass</em> which trivially follows from the
<em>atomic mass</em> of the elements in the formula and their quantities in the formula.</p>

    <p>A <em>compound</em> combines at least 2 different elements. There are 2 types of compounds:</p>
    <ul><commit_msg>Edited document<commit_after><!doctype html>
<html>
  <head>
    <title>Introduction to Chemistry</title>
    <style>
table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 15px;
}
.ce {
  font-size: x-large;
}
    </style>
  </head>
  <body>

    <h1>Introduction to Chemistry</h1>

    <h2>Introduction</h2>

    <p>This is a brief introduction to chemistry. It is like a summary, or "cheat sheet". It includes a small introduction
to organic chemistry.</p>

    <p>This summary is primarily based on the material in <a href="https://chem.libretexts.org/Bookshelves/Introductory_Chemistry/Book%3A_Beginning_Chemistry_(Ball)">Beginning Chemistry</a>.</p>

    <p>It is handy to always have a browser tab open with the <a href="https://www.rsc.org/periodic-table" target="_blank">Periodic Table</a>.</p>

    <h2>Atoms</h2>

    <p><em>Matter</em> is anything that has mass and takes up space. A <em>substance</em> is matter that has the same physical
and chemical properties throughout.</p>

    <p>An <em>element</em> is a substance that cannot be broken down into simpler chemical substances by ordinary
chemical means.</p>

    <p>The smallest piece of an element that maintains the identity of the element is called an <em>atom</em>. Hence all
matter is made from atoms.</p>

    <p>Each atom contains:</p>
    <ul>
      <li>A compact <em>nucleus</em> containing:</li>
        <ul>
          <li><em>Protons</em>. They are positively charged (1+), and weigh about 1.6e<sup>-27</sup> kg.</li>
          <li><em>Neutrons</em>. They are uncharged, and weigh about the same as protons (slightly more).</li>
        </ul>
      <li><em>Electrons</em>. They are negatively charged (1-), and weigh only about 9.1e<sup>-31</sup> kg.
These electrons circle around the nucleus at a relatively large distance from it.</li>
    </ul>

    <p>If the atom is uncharged, it has the same number of protons as electrons.</p>

    <h2>Periodic Table</h2>

    <p>All known elements occur in the <em>periodic table</em>, in a purposely chosen layout. For each element, the following
data (and more) is found in the periodic table:</p>
    <ul>
      <li>Name of the element. E.g. Hydrogen, Helium, Carbon, Oxygen, Silver.</li>
      <li><em>Element symbol</em>. E.g. (corresponding with the names above) H, He, C, O, Ag.</li>
      <li><em>Atomic number</em>. This is the number of protons, and uniquely identifies the element.</li>
      <li>Key <em>isotopes</em>. While the number of protons is fixed, the number of neutrons can vary for one element,
thus leading to different isotopes. E.g. <sup>12</sup>C, <sup>13</sup>C, <sup>14</sup>C.</li>
      <li><em>Atomic mass</em>. This is the (average) sum of the number of protons and neutrons. Given that there can be multiple
isotopes (some abundantly available, some rare), this is typically not a whole number, but it is a weighted average.</li>
      <li>Density, in g/cm<sup>3</sup>.</li>
      <li>Other physical properties like state at room temperature, melting point, boiling point.</li>
      <li>Uses and properties, history.</li>
    </ul>

    <p>An <em>atomic mass unit</em> (<em>u</em>) is approximately the mass of 1 proton or neutron. More precisely, an
atomic mass unit is one-twelfth of the mass of a carbon-12 atom, which is a carbon isotope having 6 protons and 6 neutrons. The
<em>mass number</em> of an isotope of an element is the exact number of protons plus the exact number of neutrons (which
clearly is a whole number for the isotope). Given that isotopes of an element occur in a given ratio, the <em>atomic mass</em>
of an element is the weighted average mass number for that element.</p>

    <p>There is more interesting data in the periodic table, but for that we need to know more about electron configurations.
In a quantum-mechanical model of an atom, the state of an electron is described by 4 <em>quantum numbers</em>:</p>
    <ul>
      <li><em>Principal quantum number</em>, or <em>n</em>. It identifies the <em>shell</em>, which can be thought of as the
distance to the nucleus. It is a non-zero whole number: 1, 2 or higher. The higher the number, the further the shell is from
the nucleus, and the more energy the electrons in that shell have.</li>
      <li><em>Angular momentum quantum number</em>, or <em>l</em>. It identifies the <em>subshell</em> within a shell.
It is any number between 0 and <em>n - 1</em>.</li>
      <li><em>Magnetic quantum number</em>, or <em>m<sub>l</sub></em>. It is any integer between <em>-l</em> and <em>l</em>.</li>
      <li><em>Spin quantum number</em>. It is either <em>1/2</em> or <em>-1/2</em>.</li>
    </ul>

    <p>The <em>Pauli exclusion principle</em> states that no 2 electrons in an atom can have the same set of 4 quantum numbers.
Keep that in mind below, when talking about electron configurations. Note that for subshell <em>l</em> (in a given shell)
there can be <code>2 * l + 1</code> different magnetic quantum numbers, so <code> 2 * (2 * l + 1)</code> electrons
(taking the 2 different spin quantum numbers in mind).</p>

    <p>The quantum numbers lead to the <em>electron configuration</em> of an element in the periodic table. First give the
subshells a letter instead of number, namely <em>s</em>, <em>p</em>, <em>d</em> and <em>f</em> for subshell 0, 1, 2 and 3,
respectively. Remember this as <em>SPeeD, Fine</em>, for example. The electron configuration repeats the pattern
shell-subshell-(electron-count). For example:</p>
    <ul>
      <li><em>1s<sup>1</sup></em> for H. That is: shell 1, subshell s (or 0), and 1 electron in that subshell.</li>
      <li><em>1s<sup>2</sup></em> for He. That is: shell 1, subshell s (or 0), and 2 electrons in that subshell, which is the
maximum number of electrons in any <em>s</em> subshell.</li>
      <li><em>[He]2s<sup>2</sup>2p<sup>2</sup></em> for C. Note that [He] stands for <em>1s<sup>2</sup></em>, but there is no
need to repeat that (which will become clear later). Also note that for increasing atomic numbers first the lower level shells
are filled, roughly, and that per subshell the order is roughly s-p-d-f when "filling electrons".</li>
      <li><em>[Xe]4f<sup>14</sup>5d<sup>10</sup>6s<sup>1</sup></em> for Au (gold). All subshells but the last are completely
filled.</li>
    </ul>

    <p>Note that for uncharged atoms, the number of electrons and protons are the same, which makes sense because protons
and electrons have the opposite charge (1 and -1, respectively). Hence, the number of electrons is the same as the atomic
number. Note that the number of electrons also easily follows from the electron configuration.</p>

    <p>Also note that electrons start to fill the "lowest energy positions" that are not filled. This is clearly visible in the
periodic table, for increasing atomic numbers.</p>

    <p>The electron configuration of an element tells us a lot about reactivity. When shells and subshells are completely filled,
the atom is so stable that it hardly reacts, if at all. That's the case for <em>noble gases</em>, like He, Ne, Ar, Kr and Xe.
The <em>octet rule</em> says that atoms like to have 8 electrons in their valence shell. More about that (and exceptions)
later.</p>

    <p>For each element, the highest numbered shell is called the <em>valence shell</em>. The electrons in the valence shell,
plus the electrons in the last unfilled subshell are called <em>valence electrons</em> (but beware of double counting). Elements
with similar electron configuration in their valence shells have similar chemistry. This is represented in the periodic table
by elements having the same column. For example, the noble gases all have fully filled shells and subshells, and they are all
found in the rightmost column.</p>

    <p>One trend in the periodic table is that the <em>atomic radius</em> goes up if we go down in one column (group), but
goes down if we go to the right in one row (period). The reasons are: going down in one group means an extra shell, increasing
the atomic radius, but going to the right in one period means more protons and therefore more positive charge attracting
the valence electrons.</p>

    <p>The <em>ionization energy</em> is the amount of energy required to remove an electron from an atom in the gas phase.
Going down in the periodic table means decreasing ionization energy, because the valence electron is further away from the
nucleus, due to it being in a higher numbered shell. Going to the right in the periodic table means increasing ionization
energy, due to the increasing pull on the electrons by the increasing number of protons.</p>

    <p>There is more than one IE (ionization energy), for removing successive electrons (if the atom has them).
These successive IE's increase, due to the larger net positive charge.</p>

    <p>The opposite of IE is <em>electron affinity</em> (EA). That is the energy change when a gas-phase atom accepts an
electron. The general trend (in kJ/mol) is obvious, but there is no definitive trend.</p>

    <p><em>Electronegativity</em> is a qualitative scale for judging how much an atom of a given element attracts electrons to
itself in a chemical bond. Electronegativity (Pauling scale) is the highest for fluorine, that is the top right corner of the
periodic table with the exception of the noble gas group (at the last column). It is the lowest at the botton left corner.
Obviously, due to the octet rule, halogens (in the column directly left of the noble gases) have high electronegativity.
These elements "want to attract" an electron to fully fill their valence shell with 8 instead of 7 electrons. Indeed,
going from left to right in the periodic table tends to increase the electronegativity. In left columns, the metals there
want to shed electrons rather than attract them, according to the octet rule. When going down, electronegativity decreases,
which makes sense in that valence electrons are further away from the positively charged nucleus.</p>

    <p>Strictly, electronegativity is a property of an atom within a molecule, rather than an inherent property of an atom.</p>

    <p>Electronegativity helps in understanding covalent bonds (molecules) versus ionic bonds. The difference in electronegativity
between atoms determines the kind of bond. If this difference is less than 2, the bond is <em>covalent</em>. A difference still
makes the molecule <em>polar</em>, with part of the molecule is positively charged, and part of the molecule is negatively
charged. If this difference is greater than 2, as is the case between metals and nonmetals, the bond between the atoms
is <em>ionic</em>. Recall that in covalent bonds, electrons are shared, whereas in ionic bonds, electrons move from one
atom to the other, thus leading to a bond between ions. Organic compounds (having elements such as C, H, O, N etc.) tend to
be molecular, due to electronegativity differences between them being smaller than 2.</p>

    <p>TODO Groups of elements (halogens, metals, noble gases, etc.)</p>

    <h2>Molecules, Ions and Ionic Compounds</h2>

    <p>A <em>molecule</em> is the smallest part of a substance that has the physical and chemical properties of that substance.
They combine atoms in whole-number ratios. Molecules have no charge, and their atoms are bound by <em>covalent</em> bonds.
That is, their atoms <em>share electrons</em>, instead of one atom stealing the other atom's electrons (which would instead
lead to ionic compounds).</p>

    <p>There are 2 kinds of molecules:</p>
    <ul>
      <li><em>Single-element molecules</em>, or element molecules, or molecular elements.</li>
      <li><em>Molecular compounds</em> (being compounds implies that more than 1 element is involved).
More precisely, a molecular compound combines 2 or more nonmetals.</li>
    </ul>

    <p>Some elements exist naturally as molecules (2-atom or having more than 2 atoms), for example H<sub>2</sub>,
O<sub>2</sub>, P<sub>4</sub> and S<sub>8</sub>.</p>

    <p>Molecules (with a given <em>molecular formula</em>) have a <em>molecular mass</em> which trivially follows from the
<em>atomic mass</em> of the elements in the formula and their quantities in the formula.</p>

    <p>A <em>compound</em> combines at least 2 different elements. There are 2 types of compounds:</p>
    <ul>
{'fraction_non_alphanumeric': 0.09972287537789722, 'fraction_numerical': 0.008271750083977158, 'mean_word_length': 3.945390365448505, 'pattern_counts': {'":': 0, '<': 623, '<?xml version=': 0, '>': 623, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5875142', 'n_tokens_mistral': 7231, 'n_tokens_neox': 6627, 'n_words': 3361}