Skip to content

Commit f26cb1b

Browse files
committed
source commit: 586301c
0 parents  commit f26cb1b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+963
-0
lines changed

2023-11-20_tolkien_counts.xlsx

10 KB
Binary file not shown.
601 KB
Binary file not shown.
Binary file not shown.

AUTHORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- [Belinda Weaver](https://github.com/weaverbel), Griffith University Library

CODE_OF_CONDUCT.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: "Contributor Code of Conduct"
3+
---
4+
5+
As contributors and maintainers of this project,
6+
we pledge to follow the [The Carpentries Code of Conduct][coc].
7+
8+
Instances of abusive, harassing, or otherwise unacceptable behavior
9+
may be reported by following our [reporting guidelines][coc-reporting].
10+
11+
12+
[coc-reporting]: https://docs.carpentries.org/topic_folders/policies/incident-reporting.html
13+
[coc]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html

LICENSE.md

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: "Licenses"
3+
---
4+
5+
## Instructional Material
6+
7+
All Carpentries (Software Carpentry, Data Carpentry, and Library Carpentry)
8+
instructional material is made available under the [Creative Commons
9+
Attribution license][cc-by-human]. The following is a human-readable summary of
10+
(and not a substitute for) the [full legal text of the CC BY 4.0
11+
license][cc-by-legal].
12+
13+
You are free:
14+
15+
- to **Share**---copy and redistribute the material in any medium or format
16+
- to **Adapt**---remix, transform, and build upon the material
17+
18+
for any purpose, even commercially.
19+
20+
The licensor cannot revoke these freedoms as long as you follow the license
21+
terms.
22+
23+
Under the following terms:
24+
25+
- **Attribution**---You must give appropriate credit (mentioning that your work
26+
is derived from work that is Copyright (c) The Carpentries and, where
27+
practical, linking to <https://carpentries.org/>), provide a [link to the
28+
license][cc-by-human], and indicate if changes were made. You may do so in
29+
any reasonable manner, but not in any way that suggests the licensor endorses
30+
you or your use.
31+
32+
- **No additional restrictions**---You may not apply legal terms or
33+
technological measures that legally restrict others from doing anything the
34+
license permits. With the understanding that:
35+
36+
Notices:
37+
38+
* You do not have to comply with the license for elements of the material in
39+
the public domain or where your use is permitted by an applicable exception
40+
or limitation.
41+
* No warranties are given. The license may not give you all of the permissions
42+
necessary for your intended use. For example, other rights such as publicity,
43+
privacy, or moral rights may limit how you use the material.
44+
45+
## Software
46+
47+
Except where otherwise noted, the example programs and other software provided
48+
by The Carpentries are made available under the [OSI][osi]-approved [MIT
49+
license][mit-license].
50+
51+
Permission is hereby granted, free of charge, to any person obtaining a copy of
52+
this software and associated documentation files (the "Software"), to deal in
53+
the Software without restriction, including without limitation the rights to
54+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
55+
of the Software, and to permit persons to whom the Software is furnished to do
56+
so, subject to the following conditions:
57+
58+
The above copyright notice and this permission notice shall be included in all
59+
copies or substantial portions of the Software.
60+
61+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
62+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
63+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
64+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
65+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
66+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
67+
SOFTWARE.
68+
69+
## Trademark
70+
71+
"The Carpentries", "Software Carpentry", "Data Carpentry", and "Library
72+
Carpentry" and their respective logos are registered trademarks of [Community
73+
Initiatives][ci].
74+
75+
[cc-by-human]: https://creativecommons.org/licenses/by/4.0/
76+
[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode
77+
[mit-license]: https://opensource.org/licenses/mit-license.html
78+
[ci]: https://communityin.org/
79+
[osi]: https://opensource.org

computation_practice.md

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: Computational thinking in practice
3+
teaching: 20
4+
exercises: 10
5+
---
6+
7+
::::::::::::::::::::::::::::::::::::::: objectives
8+
9+
- Understand the difference between programming and computational thinking
10+
- Recognize how computational thinking is applied in everyday life
11+
- Learn the steps of computational thinking such as problem breakdown, pattern recognition, and developing algorithms
12+
13+
::::::::::::::::::::::::::::::::::::::::::::::::::
14+
15+
:::::::::::::::::::::::::::::::::::::::: questions
16+
17+
- What is the difference between programming and computational thinking?
18+
- How is computational thinking used in daily life?
19+
- What are the steps involved in computational thinking?
20+
- How can structure diagrams help in breaking down problems?
21+
22+
::::::::::::::::::::::::::::::::::::::::::::::::::
23+
24+
25+
While thinking computationally is a prerequisite for programming, programming and computational thinking are not the same thing.
26+
27+
| **Programming** | &nbsp; | **Computational thinking** |
28+
| :---: | :---: | :---: |
29+
| instructs a computer to carry out a sequence of steps in a particular order. | &nbsp; | is the process that helps decide what those steps will be, i.e. what the computer will be told to do. |
30+
31+
------
32+
33+
Computers are precise, and computing instructions must be clear and unambiguous, as the computer cannot think - it can only follow orders. Unlike humans, computers do not get bored or distracted, they process data very quickly, and will carry out the same tedious, repetitive tasks over and over again without making mistakes.
34+
35+
![The computational thinking process in action](fig/proc-diagram.png){alt="Computational thinking at work" width="100%"}
36+
37+
#### Computational thinking in our daily lives
38+
39+
Subconsciously, we practise computational thinking every day of our lives.
40+
41+
::::::::::::::::::::::::::::::::::::::::::: testimonial
42+
43+
“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.”
44+
45+
— Jeannette Wing
46+
47+
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
48+
49+
Every time we need to plan to do something, we use some of the steps of computational thinking such as problem breakdown, pattern recognition and developing algorithms.
50+
51+
- Project managers use computational thinking to plan complex activities such as building a tunnel or revamping a playground.
52+
53+
- Epidemiologists use it to identify patterns that help predict how a disease outbreak will spread.
54+
55+
- Parents use it to juggle work, parenting, community responsibilities and housework.
56+
57+
- Lost hikers can use it to try to find their way out of the forest.
58+
59+
#### Breaking problems down with structure diagrams
60+
61+
When trying to solve problems, it is essential to break them down into their constituent parts. Pasting sticky notes on a wall is one way to visualise the necessary steps.
62+
63+
Structure diagrams also allow you to plan problem breakdown visually. At the top should be the objective, and the steps underneath should start with high level considerations. These high level considerations can then be broken down into smaller and smaller steps.
64+
65+
In the hiking scenario, the group of four people have to try to solve the problem of being lost. This diagram is the very start of their thinking about their immediate needs.
66+
67+
![Basic Structure Diagram](fig/structure.png){alt="Structure diagram" width="100%"}
68+
69+
---------
70+
71+
:::challenge
72+
## Practice
73+
74+
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.
75+
:::
76+
77+
:::::::::::::::::::::::::::::::::::::::: keypoints
78+
79+
- Computational thinking involves breaking down problems, recognizing patterns, and developing algorithms.
80+
- While programming is instructing a computer to carry out tasks, computational thinking helps decide what those tasks will be.
81+
- Computational thinking is used in various fields, from project management to epidemiology, and even in daily tasks.
82+
- Structure diagrams are useful tools for visually breaking down and planning problem-solving steps.
83+
84+
::::::::::::::::::::::::::::::::::::::::::::::::::
85+

computation_programming.md

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: Computational thinking in programming
3+
teaching: 30
4+
exercises: 10
5+
---
6+
7+
::::::::::::::::::::::::::::::::::::::: objectives
8+
9+
- Understand the importance of decomposition in programming
10+
- Learn how to break down a problem into discrete parts for programming
11+
- Recognize the difference between linear and branching code
12+
- Apply pattern recognition to adapt existing code for new problems
13+
14+
::::::::::::::::::::::::::::::::::::::::::::::::::
15+
16+
:::::::::::::::::::::::::::::::::::::::: questions
17+
18+
- Why is decomposition crucial in programming?
19+
- How can we break down a problem like counting words in a text?
20+
- What is the difference between linear and branching code?
21+
- How can pattern recognition help in programming?
22+
23+
::::::::::::::::::::::::::::::::::::::::::::::::::
24+
25+
*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.
26+
27+
Suppose we want to find the ten words most commonly used in a text. How might we go about that?
28+
29+
#### Linear code
30+
31+
While there are many different ways to do this task, this is one way, where all the commands are run in a linear sequence, e.g.,
32+
33+
![Counting words in a text](fig/count-words.png){alt="counting words in a text" width="60%"}
34+
35+
First we save the file in `.txt` format to eliminate all the "smart" formatting created by programs like Word (as they would otherwise introduce a messy bunch of extraneous characters). Then we progressively eliminate everything from the text that is not a word, i.e. punctuation.
36+
37+
Converting all the words to lower case means we end up with a single version of each word - not two. This is important because, to a computer, `Word` (starting with an upper case letter) does not equal `word` (starting with a lower case letter) - it treats them as two separate entities.
38+
39+
By replacing spaces with `new line` characters, each word will end up on its own line, which makes them easy to sort alphabetically and then count.
40+
41+
Each part of the sequence would need to be individually programmed. Fortunately, programmers can adapt code that others have already used to do similar tasks, such as code to identify letter, number or word frequency. Once you are coding, this is where the computational thinking skill of *pattern recognition* comes in - identifying similar code that can be used for or adapted to the specific problem you want to solve.
42+
43+
--------
44+
45+
#### Branching code
46+
47+
Programming rarely works in such a linear fashion. Code generally includes branching so that different pathways can be taken, depending on whether or not certain conditions are met, e.g., different responses to a `Yes/No` or `True/False` decision, as in the example here.
48+
49+
![Branching code](fig/workflow.png){alt="Branching code" width="90%"}
50+
51+
----------------
52+
53+
:::challenge
54+
## Hiking Preparation Strategy
55+
56+
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.
57+
:::
58+
59+
:::::::::::::::::::::::::::::::::::::::: keypoints
60+
61+
- Decomposition is essential for breaking down problems into discrete parts in programming.
62+
- Computers require precise instructions, and problems must be broken down accordingly.
63+
- Linear code runs commands in a sequence, while branching code allows for different pathways based on conditions.
64+
- Pattern recognition helps programmers adapt existing code for new problems.
65+
66+
::::::::::::::::::::::::::::::::::::::::::::::::::

exercise.md

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
title: Exercise
3+
teaching: 25
4+
exercises: 20
5+
---
6+
7+
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.
8+
9+
Seems impossible?
10+
11+
It's not.
12+
13+
Using the first computational thinking step - *Decomposition* - we break the problem up into smaller pieces. Rather than trying to add the numbers up sequentially, which would be challenging for many people to do in their heads, let's approach the task in a different way.
14+
15+
::::::::: challenge
16+
17+
## Decomposition
18+
19+
Let's begin at each end of the 1-200 sequence by adding up the first and last numbers.
20+
21+
What is `200 + 1`?
22+
23+
:::::::: solution
24+
The answer is `201`.
25+
:::::::
26+
27+
Let's now add up the second and the second last numbers, i.e. `199 + 2`.
28+
29+
:::::::: solution
30+
The answer is `201`.
31+
:::::::
32+
33+
Let's now add up the third and the third last numbers, i.e. `198 + 3`.
34+
35+
:::::::: solution
36+
The answer is `201`.
37+
:::::::
38+
39+
:::::::::
40+
41+
-------
42+
43+
### Pattern recognition
44+
45+
Using our second step - *Pattern recognition* - we should be able to spot a clear pattern, i.e. that each pair of numbers appears to add up to `201`.
46+
47+
![Spotting a pattern](fig/word-count.png){alt="Spotting a pattern" width="25%"}
48+
49+
If we follow this same process with **all** the numbers between 1 and 200, we will end up with **100 pairs**, each of which will add up to `201`.
50+
51+
-------
52+
53+
### Algorithm
54+
55+
Using an *Algorithm* - another name for a series of steps - how do we calculate the final total?
56+
57+
We multiply the `number of pairs` (100) by `201` (the total to which each pair adds up).
58+
59+
`100 * 201` gives us the answer of `20,100`.
60+
61+
So far, so good.
62+
63+
Now, what about about our fourth step, *Abstraction*?
64+
65+
-------
66+
67+
### Abstraction
68+
69+
*Abstraction* will enable us to generalise from that experience, i.e. repeat the process we used to add up all the numbers between 1 and 200 to add up a *different* set of numbers, e.g., 1-500.
70+
71+
The *Algorithm* will be
72+
73+
(`number to be added` divided by 2) multiplied by (`number to be added` +1). We can express that as an algebraic formula:
74+
75+
`(x/2) * (x + 1)`
76+
77+
where *`x`* is the `number to be added`.
78+
79+
-------------
80+
81+
That's it! Using those four key steps, we have learned the basics of computational thinking.
82+
83+
---------
84+
85+
::::::::::::::::::::::::::::::::: challenge
86+
87+
## Practice
88+
89+
Use the algorithm above to add up all the numbers between 1 and 24, 1 and 50, and 1 and 1,000.
90+
91+
::::::::::::::
92+
93+
::::::::::::::::::::::::::::::::: discussion
94+
95+
## Discussion
96+
97+
The numbers above are all even numbers. What would be the process for adding up numbers if the final number is an odd one, e.g., 17? Can you use the same formula? If not, what adaptations would you need to make to the formula?
98+
:::

fig/arrowing.png

6.14 KB
Loading

fig/arrows.png

3.83 KB
Loading

fig/brain.png

1.7 KB
Loading

fig/brains.png

5.74 KB
Loading

fig/code-in-shell.png

2.32 KB
Loading

fig/cognitive-restructure.jpg

4.48 MB
Loading

fig/comp-think.png

49.4 KB
Loading

fig/count-words.png

21.9 KB
Loading

fig/loop-diagram.png

33 KB
Loading

fig/loop-pseudocode.png

45.2 KB
Loading

fig/loop-shell.png

23.5 KB
Loading

fig/move-pseudocode.png

23.1 KB
Loading

fig/pattern-spot.png

4.07 KB
Loading

fig/pattern.png

8.73 KB
Loading

fig/postits.jpg

292 KB
Loading

fig/proc-diagram.png

33.8 KB
Loading

fig/pseudo-example.png

35.7 KB
Loading

fig/pseudo-loop.png

34.5 KB
Loading

fig/pseudocode.png

55.9 KB
Loading

fig/stickies.jpg

2.17 MB
Loading

fig/struct-1.png

9.71 KB
Loading

fig/structure.png

14.1 KB
Loading

fig/tr-options.png

38.5 KB
Loading

fig/travel-diag.png

19.3 KB
Loading

fig/word-count.png

4.71 KB
Loading

fig/workflow.png

41.5 KB
Loading

index.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
site: sandpaper::sandpaper_site
3+
---
4+
5+
Computational thinking is an essential prerequisite for anyone wanting to learn to program computers and write code.
6+
This workshop will take you through the steps to develop a computational mindset. This lesson was initially conceived and designed by
7+
[Belinda Weaver](https://github.com/weaverbel) ([ORCiD](https://orcid.org/0000-0002-6156-7997)).
8+
9+
## Learning Objectives
10+
11+
Once you have completed this workshop, you should be able to:
12+
13+
- Identify the steps involved in computational thinking
14+
- Break a problem down into more manageable parts
15+
- Develop a series of steps (an *algorithm*) to solve the problem
16+
- Generalise the steps to make the algorithm re-usable (*abstraction*)
17+
18+
:::: prereq
19+
20+
## Prerequisites
21+
22+
To successfully complete this workshop you will need:
23+
24+
- A pen and paper
25+
26+
::::
27+

instructor-notes.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 'Instructor Notes'
3+
---
4+
5+
Slides and notes for this lesson:
6+
7+
- [Introducing Computational Thinking powerpoint](2024-05-20_comp-think-open-version.pptx)
8+
- [Notes for Slides](2024-05-31_script-for-teaching-comp-thinking.pdf)

0 commit comments

Comments
 (0)