Computing and Data Science

Introduction to Python

Write your solutions into a Google Colab. Be sure to number your solutions with text cells or Python comments.
  1. Write the following arithmetic expressions and print the results:
    1. \(\quad5 + 18\)
    2. \(\quad \sqrt{3^2+4^2}\)
    3. \(\quad\frac{10+16}{5-3}\)
    4. \(\quad \frac{\sqrt{2}}{2}\)
    5. \(\quad\frac{32}{7}\)
    6. \(\quad \frac{\sqrt{3}-\frac{1}{2}}{3+\sqrt{5}}\)
    7. \(\quad\frac{4}{5} \times 8\)
    8. \(\quad \sqrt{5+\sqrt{3}}\)
    9. \(\quad\frac{3+5 \times 7}{6}\)
    10. \(\quad \frac{\sin^{2}\left(\frac{1}{2}\right)}{1-\cos\left(\frac{1}{2}\right)}\)
    11. \(\quad\frac{12-7}{4+8}\)
    12. \(\quad \frac{\frac{3}{4}+2}{1+2}\)
  2. In separate code cells, write a script that:
    1. Creates a variable \(x\) and assigns it the value 0.05
    2. Assigns \(x\) the updated value of: \(3x(1-x)\)

    Run the cell containing only part b several times until it "converges".
  3. Plot the following data in three different ways:
    XY
    24.6
    33.3
    52.7
    73.5
    84.9
    105.8
  4. Re-create the plots below. It will be helpful to familiarize with the Matplotlib documentation, including the Pyplot tutorial and perhaps the markers_api.