Skip to content

Commit

Permalink
Merge pull request #9 from LibraryCarpentry/learning-objectives-quest…
Browse files Browse the repository at this point in the history
…ions-for-epis

adding episode learning objectives
  • Loading branch information
chennesy authored Aug 1, 2024
2 parents b14dd24 + e1cd270 commit 6036a8e
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 10 deletions.
31 changes: 30 additions & 1 deletion episodes/computation_practice.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
---
title: Computational thinking in practice
nav: Two
teaching: 20
exercises: 10
---

::::::::::::::::::::::::::::::::::::::: objectives

- Understand the difference between programming and computational thinking
- Recognize how computational thinking is applied in everyday life
- Learn the steps of computational thinking such as problem breakdown, pattern recognition, and developing algorithms

::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::: questions

- What is the difference between programming and computational thinking?
- How is computational thinking used in daily life?
- What are the steps involved in computational thinking?
- How can structure diagrams help in breaking down problems?

::::::::::::::::::::::::::::::::::::::::::::::::::


While thinking computationally is a prerequisite for programming, programming and computational thinking are not the same thing.

| **Programming** |   | **Computational thinking** |
Expand Down Expand Up @@ -48,3 +67,13 @@ In the hiking scenario, the group of four people have to try to solve the proble

Imagine that night is now falling fast, and our friends are still stuck in the forest. Add some more detail to the structure diagram to help them survive the night.
:::

:::::::::::::::::::::::::::::::::::::::: keypoints

- Computational thinking involves breaking down problems, recognizing patterns, and developing algorithms.
- While programming is instructing a computer to carry out tasks, computational thinking helps decide what those tasks will be.
- Computational thinking is used in various fields, from project management to epidemiology, and even in daily tasks.
- Structure diagrams are useful tools for visually breaking down and planning problem-solving steps.

::::::::::::::::::::::::::::::::::::::::::::::::::

33 changes: 30 additions & 3 deletions episodes/computation_programming.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
---
title: Computational thinking in programming
nav: Three
teaching: 30
exercises: 10
---

::::::::::::::::::::::::::::::::::::::: objectives

- Understand the importance of decomposition in programming
- Learn how to break down a problem into discrete parts for programming
- Recognize the difference between linear and branching code
- Apply pattern recognition to adapt existing code for new problems

::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::: questions

- Why is decomposition crucial in programming?
- How can we break down a problem like counting words in a text?
- What is the difference between linear and branching code?
- How can pattern recognition help in programming?

::::::::::::::::::::::::::::::::::::::::::::::::::

*Decomposition* is crucial in any kind of problem breakdown, but especially so in programming. The computer must be told **precisely** what to do, and in what order, so problems must be broken down into discrete parts and each section coded appropriately.

Suppose we want to find the ten words most commonly used in a text. How might we go about that?
Expand Down Expand Up @@ -33,7 +51,16 @@ Programming rarely works in such a linear fashion. Code generally includes branc
----------------

:::challenge
## Practice
## Hiking Preparation Strategy

Our friends have finally made it out of the forest and back to civilisation. Their experience, while unpleasant, has not put them off hiking. Draw a structure diagram of the planning they need to do for next time to avert another disaster.
:::

:::::::::::::::::::::::::::::::::::::::: keypoints

- Decomposition is essential for breaking down problems into discrete parts in programming.
- Computers require precise instructions, and problems must be broken down accordingly.
- Linear code runs commands in a sequence, while branching code allows for different pathways based on conditions.
- Pattern recognition helps programmers adapt existing code for new problems.

::::::::::::::::::::::::::::::::::::::::::::::::::
3 changes: 2 additions & 1 deletion episodes/exercise.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Exercise
nav: One
teaching: 25
exercises: 20
---

In this exercise, we will see how computational thinking can be used to add up all the numbers between 1 and 200 in our heads, i.e. `1 + 2 + 3 + 4` and so on. We should be able to do this in less than a minute.
Expand Down
32 changes: 29 additions & 3 deletions episodes/intro.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
---
title: Introduction
nav: Intro
teaching: 45
exercises: 30
---
::::::::::::::::::::::::::::::::::::::: objectives

- Understand the concept and importance of computational thinking
- Learn the four components of computational thinking: decomposition, pattern recognition, algorithms, and abstraction
- Recognize how computational thinking can be applied to solve complex problems

::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::: questions

- What is computational thinking?
- What are the four components of computational thinking?
- How can computational thinking help solve complex problems?
- Why is ethical consideration important in automation and algorithm design?

::::::::::::::::::::::::::::::::::::::::::::::::::

Computational thinking is an essential prerequisite for anyone wanting to learn to program computers and write code.

Expand Down Expand Up @@ -40,15 +57,15 @@ There are four essential components of computational thinking:
- **Algorithms** – developing step-by-step solutions to each part of the problem
- **Abstraction** – generalising (abstracting) the important detail to make a solution reusable

-------
::::::::::::::::::::::::::::::::::::::::: callout

Professor Jeannette Wing raised computational thinking as an important issue for researchers in a 2006 paper. She stated, *"Informally, computational thinking describes the mental activity in formulating a problem to admit a computational solution. The solution can be carried out by a human or machine, or more generally, by combinations of humans and machines."*

![](fig/brains.png){alt="brain" width="40%"}

Wing believes that computational thinking is just as important a skill for school children to learn as reading, writing and arithmetic. Increasingly, schools are including computational thinking in school curricula.

-------------
::::::::::::::::::::::::::::::::::::::::::::::::::

#### But first, do no harm ...

Expand Down Expand Up @@ -79,6 +96,15 @@ Our friends in the forest are still in the shouting, blaming and squabbling stag

-------------

:::::::::::::::::::::::::::::::::::::::: keypoints

- Computational thinking involves strategies to solve complex problems and can be applied to both humans and computers.
- The four components of computational thinking are decomposition, pattern recognition, algorithms, and abstraction.
- Computational thinking is essential for problem-solving in programming and other fields.
- Ethical considerations and human oversight are crucial in automation to avoid biases and ensure transparency.

::::::::::::::::::::::::::::::::::::::::::::::::::

#### References

1. [British Broadcasting Corporation](https://www.bbc.com/) BBC Bitesize. [KS3: Introduction to computational thinking](https://www.bbc.com/bitesize/guides/zp92mp3/revision/1).
Expand Down
83 changes: 81 additions & 2 deletions episodes/pseudocode.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
---
title: Pseudocode
nav: Four
teaching: 30
exercises: 15
---

::::::::::::::::::::::::::::::::::::::: objectives

- Understand the purpose and benefits of pseudocode in programming
- Learn to write pseudocode to break down coding problems
- Apply pseudocode to explain programming needs to others
- Recognize how loops and variables function in pseudocode and programming

::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::: questions

- What is pseudocode and why is it useful?
- How can pseudocode help in planning a coding solution?
- What are loops in programming, and how do they work?
- How can variables and abstraction be used in coding?

::::::::::::::::::::::::::::::::::::::::::::::::::

Regardless of programming language, **pseudocode** is a useful tool to break coding problems down. Pseudocode helps you list each step of a planned process so your steps are in a logical order before you code.

Pseudocode is also a good way to explain your needs to software developers or to run your ideas past people who may not be programmers.
Expand Down Expand Up @@ -48,6 +67,40 @@ In a folder, we have 250 image files for which we want to create backup copies b

Write some pseudocode of how you might automate this process.

::: solution

## Potential solution

*Steps in the copying process*

![Steps in the copying loop](fig/pseudo-loop.png){alt="Steps in the loop" width="70%"}


### Example code in the Unix shell

```{bash, results="hide"}
for filename in "*.jpg" "*.tif" "*.png"
do
cp $filename backup-$filename
echo $filename backup-$filename
done
```


![Coding a loop in the Unix shell](fig/loop-shell.png){alt="Loop as it would be written in the Unix shell" width="90%"}

*Notes*

In the code example above, the loop will run through the folder creating back up copies of all the files with the file extension `.jpg`. As each file is copied, each original filename and the filename of each new file will be printed to the screen.

Then the loop will restart and repeat the process for all the files with the file extension `.tif`, again printing the original filenames and the filenames of the new files to the screen.

Then the loop will restart and run through the folder a third time, creating back up copies of all the files with the file extension `.png`, again printing the original filenames and the filenames of the new files to the screen.

The loop will then stop, as there are no more variables to work on.

:::

:::

::: challenge
Expand All @@ -58,6 +111,23 @@ We have a large folder of files left over from a project that is now finished. T

Write some pseudocode of how you might automate this process.

::: solution

## Potential solution

*Steps in the moving process*

1. Identify the different file types in the folder.
2. Create new folders to house the different file types.
3. Create a series of loops to work through the folder, file type by file type, moving the files to the correct folders.
4. Once the final loop has run, delete all remaining files left within the main folder.
5. Print filenames to the screen as the loop runs to verify it is working as required.

*Using a shell script to automate the work*

The task above could be fully automated using a shell script. A shell script is a text file containing a sequence of commands for a UNIX-based operating system that allows those commands to be run in one go, rather than by entering each command one at a time. Scripts make task automation possible. The script would contain the commands to do the tasks listed above, such as folder creation, file movement using loops, file deletion and so on. The benefit of shell scripts is that the code they contain can be re-used or adapted for similar tasks.

:::
:::

::: challenge
Expand Down Expand Up @@ -107,4 +177,13 @@ Suppose you write that file movement script and it works a treat.
Why not get it to run every month to tidy up folders that invariably become messy over time, e.g., your computer's `Downloads` folder?

Or, suppose you use a file naming convention that starts with `YYYY-MM-DD`. Why not run a script annually to sort and organize your documents by year?
:::
:::

:::::::::::::::::::::::::::::::::::::::: keypoints

- Pseudocode is a valuable tool for organizing and planning coding solutions before actual programming.
- It helps to list each step of a process logically, making it easier to translate into code.
- Loops allow the execution of repetitive tasks until certain conditions are met.
- Variables in loops can change with each iteration, demonstrating the concept of abstraction.

::::::::::::::::::::::::::::::::::::::::::::::::::

0 comments on commit 6036a8e

Please sign in to comment.