Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handout on while loops. #334

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _topics/algebra.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ video_urls:
- "Video demonstration of tutorial. - [YouTube](https://youtu.be/E_TKJkvi-GY)"
---

A handout is available [here]({{site.baseurl}}/assets/handouts/spring/02-algebra/main.pdf).
A handout is available [here]({{site.baseurl}}/assets/handouts/autumn/02-algebra/main.pdf).
2 changes: 1 addition & 1 deletion _topics/calculus.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ video_urls:
- "Video demonstration of tutorial. - [YouTube](https://youtu.be/7j4bqypXi48)"
---

A handout is available [here]({{site.baseurl}}/assets/handouts/spring/03-calculus/main.pdf).
A handout is available [here]({{site.baseurl}}/assets/handouts/autumn/03-calculus/main.pdf).
2 changes: 1 addition & 1 deletion _topics/combinatorics.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ video_urls:
- "Video demonstration of tutorial. - [YouTube](https://youtu.be/7KpC9YN_rvQ)"
---

A handout is available [here]({{site.baseurl}}/assets/handouts/spring/04-combinatorics/main.pdf).
A handout is available [here]({{site.baseurl}}/assets/handouts/autumn/04-combinatorics/main.pdf).
2 changes: 1 addition & 1 deletion _topics/differential-equations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ video_urls:
- "Video demonstration of tutorial. - [YouTube](https://youtu.be/F73G8jVwdmA?si=VMXGBcq29xINKrxE)"
---

A handout is available [here]({{site.baseurl}}/assets/handouts/spring/09-differential-equations/main.pdf).
A handout is available [here]({{site.baseurl}}/assets/handouts/autumn/09-differential-equations/main.pdf).
2 changes: 2 additions & 0 deletions _topics/functions-and-data-structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ note_urls:
video_urls:
- "Video demonstration of tutorial. - [YouTube](https://youtu.be/MPk815rdwi0)"
---

A handout is available [here]({{site.baseurl}}/assets/handouts/spring/02-functions-and-data-structures/main.pdf).
2 changes: 1 addition & 1 deletion _topics/matrices.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ video_urls:
- "Video demonstration of tutorial. - [YouTube](https://www.youtube.com/watch?v=9aoz22SxZjY)"
---

A handout is available [here]({{site.baseurl}}/assets/handouts/spring/06-matrices/main.pdf).
A handout is available [here]({{site.baseurl}}/assets/handouts/autumn/06-matrices/main.pdf).
2 changes: 1 addition & 1 deletion _topics/probability.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ video_urls:
- "Video demonstration of tutorial. - [YouTube](https://youtu.be/34mKnQ4fqHQ)"
---

A handout is available [here]({{site.baseurl}}/assets/handouts/spring/05-probability/main.pdf).
A handout is available [here]({{site.baseurl}}/assets/handouts/autumn/05-probability/main.pdf).
2 changes: 1 addition & 1 deletion _topics/sequences.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ video_urls:
- "Video demonstration of tutorial. - [YouTube](https://youtu.be/zSEv9DZ6yvw)"
---

A handout is available [here]({{site.baseurl}}/assets/handouts/spring/07-sequences/main.pdf).
A handout is available [here]({{site.baseurl}}/assets/handouts/autumn/07-sequences/main.pdf).
2 changes: 1 addition & 1 deletion _topics/statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ video_urls:
- "Video demonstration of tutorial. - [YouTube](https://youtu.be/bheeUG6iwjA?si=58jwdBN04MEKLqC4)"
---

A handout is available [here]({{site.baseurl}}/assets/handouts/spring/08-statistics/main.pdf).
A handout is available [here]({{site.baseurl}}/assets/handouts/autumn/08-statistics/main.pdf).
2 changes: 2 additions & 0 deletions _topics/variables-conditional-statements-and-while-loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ note_urls:
video_urls:
- "Video demonstration of tutorial. - [YouTube](https://youtu.be/uoIUKmnuaYQ)"
---

A handout is available [here]({{site.baseurl}}/assets/handouts/spring/01-while-loops-and-conditional-statements/main.pdf).
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
\documentclass{article}

\usepackage[margin=1.5cm, includefoot, footskip=30pt]{geometry}
\usepackage[parfill]{parskip}
\usepackage[black]{merriweather} %% Option 'black' gives heavier bold face
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{minted}

\pagenumbering{gobble}

\title{Computing for Mathematics: Handout 1}
\date{}

\begin{document}

\maketitle


This handout contains a summary of the topics covered as well as outline of
expected progress.

For further practice you can do the exercises available at
\href{https://vknight.org/pfm/building-tools/01-variables-conditionals-loops/exercises/main.html}{the
Variables, conditionals and loops chapter of Python for Mathematics}.

\section{Expected progress}
\hrule

At the end of this week you should have a group assigned.

\begin{itemize}
\item Agree on a way for your group to stay in touch;
\item Schedule 1 or 2 regular meeting times a week to work specifically on
the project.
\item Have an exchange of early ideas of possible project topics.
\end{itemize}

\begin{center}
\framebox{
\textbf{At this stage I would expect you to have some ideas written down.}
}
\end{center}

\section{Summary}\label{summary}
\hrule

The programming topics covered in the
\href{https://vknight.org/pfm/building-tools/01-variables-conditionals-loops/introduction/main.html}{variables,
conditionals and loops chapter of Python for Mathematics} are:

\begin{itemize}
\item
Creating variables

\begin{minted}[frame=single]{python}
age = 40
\end{minted}
\item
Run code depending on a given condition.


\begin{minted}[frame=single]{python}
if age < 18:
party = True
else:
party = False
age += 1
\end{minted}

\item Check type of a variable

\begin{minted}[frame=single]{python}
type(age)
\end{minted}
\item
Repeat code as long as a given condition is met.

\begin{minted}[frame=single]{python}
while boolean_condition:
<code to repeat>
\end{minted}

\item
Repeat code over a given set.


\begin{minted}[frame=single]{python}
for variable in iterable:
<code to repeat>
\end{minted}
\end{itemize}

\end{document}
Binary file not shown.
105 changes: 105 additions & 0 deletions assets/handouts/spring/02-functions-and-data-structures/main.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
\documentclass{article}

\usepackage[margin=1.5cm, includefoot, footskip=30pt]{geometry}
\usepackage[parfill]{parskip}
\usepackage[black]{merriweather} %% Option 'black' gives heavier bold face
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{minted}

\pagenumbering{gobble}

\title{Computing for Mathematics: Handout 2}
\date{}

\begin{document}

\maketitle


This handout contains a summary of the topics covered as well as outline of
expected progress.

For further practice you can do the exercises available at
\href{https://vknight.org/pfm/building-tools/02-functions-and-data-structures/exercises/main.html}{the
functions and data structures chapter of Python for Mathematics}.

\section{Expected progress}
\hrule

At the end of this week you should have a few potential ideas for projects.

\begin{itemize}
\item For each of your ideas: what tools will be in your library?
\item Have some early code for each of your ideas: this might help identify
the coding techniques you will need to learn.
\item Have an early conversation with me (Vince) about each idea.
\end{itemize}

\begin{center}
\framebox{
\textbf{At this stage I'd expect you to have some ideas and code written in a
Jupyter notebook}
}
\end{center}

\section{Summary}\label{summary}
\hrule

The programming topics covered in the
\href{https://vknight.org/pfm/building-tools/02-functions-and-data-structures/introduction/main.html}{functions
and data structures} are:

% TODO

\begin{itemize}
\item
Write docstrings:

\begin{minted}[frame=single]{python}
def square(x):
"""
Returns x ^ 2 + 1

Parameters
----------
x : float
The element x

Returns
-------
float
The image
"""
return x ** 2 + 1
\end{minted}


\item
Create a set:

\begin{minted}[frame=single]{python}
unique_values = {"one", 2, "3"}
\end{minted}


\item
Do set operations:

\begin{minted}[frame=single]{python}
unique_values = {"one", 2, "3"}
other_vaues = {1, 2, 3}
union = unique_values | other_values
intersection = unique_value & other_values
difference = unique_values - other_values
\end{minted}

\item Using hash tables (called dictionaries in Python):

\begin{minted}[frame=single]{python}
id_numbers = {"Vince": 839, "Julien": 20, "Kaitlynn": 1049}
id_numbers["Vince"]
\end{minted}
\end{itemize}

\end{document}
Loading