L4 Algorithmic Thinking 2
L4 Algorithmic Thinking 2
Starter
• How could you reduce the number of letters used
in the following quote, but still understand it?
“That’s one small step for a man, one
giant leap for mankind”
Neil Armstrong
Starter
• “That’s one small step for a man, one giant leap
for mankind”
• Some possible answers:
• That’s 1 small step for 1 man, 1 giant leap for mankind (55
chars)
• Thts 1 smll step fr 1 man, 1 giant leap fr manknd (49 chars)
• Thts 1 smll fr 1 , 1 giant leap fr knd (41 chars)
Algorithmic thinking 2
Computational thinking and logic
Compression
• Compression means reducing the amount of data
needed to store or transmit something
• Lossy compression means that some of the original data
will be lost
• Lossless compression means that none of the original data
will be lost
• Is the method you just used to compress the data
lossy or lossless?
• Describe an algorithm that could be used to compress
quotes in the way you have in the starter
Algorithmic thinking 2
Computational thinking and logic
Compression
• Is the method you just used to compress the data
lossy or lossless?
• Lossy compression
with an emoji
• IF the word has vowels in it, AND is a common word, THEN
remove the vowels
• IF the word is a number THEN replace with digits
• IF comma or apostrophe THEN remove
Algorithmic thinking 2
Computational thinking and logic
Worksheet 4
• Complete Task 1 on Worksheet 4
Algorithmic thinking 2
Computational thinking and logic
Locked-in syndrome
• Locked-in syndrome causes people to become
completely paralysed except for control of the eyes
• People with locked-in syndrome are fully conscious and
aware, so use blinking or eye movements to communicate
• If they are shown a table of the alphabet, they can blink
when
someone points to the correct letter
• Think of a word and try to communicate it with a partner
using the table on the following slide
Algorithmic thinking 2
Computational thinking and logic
Communication by blinking
• Partner 1: Think of a word. Don’t tell your partner
• Partner 2: Point to each of the letters on the alphabet in
turn
• Partner 1: If your partner says the next letter from your
word
then blink
• Partner 2: How many letters did you ask before you worked
out the word? A B C D E F G H I J
K L M N O P Q R S T
U V W X Y Z
Algorithmic thinking 2
Computational thinking and logic
Letter order
• Using the letter order of the
alphabet makes the algorithm 14
Frequency %
8
used in typical English
6
Letter order
• What is the most common letter? E
• If we redesigned the chart, what should the first four
letters be? E, T, A, O
• The full chart would be:
E T A O I N S H R D
L C U M W F G Y P B
V K X J Q Z
Algorithmic thinking 2
Computational thinking and logic
Worksheet 4
• Complete Task 2 on Worksheet 4
Algorithmic thinking 2
Computational thinking and logic
Another algorithm
• Let’s arrange the letters into a binary tree
• This time we use a LEFT or RIGHT
wink to indicate the direction on the tree
LEFT
Algorithmic thinking 2
Computational thinking and logic
Worksheet 4
• Complete Task 3 on Worksheet 4
• The answer to the previous slide is:
NOW DO NEXT TASK
Algorithmic thinking 2
Computational thinking and logic
Worksheet 4
• Complete Task 4 on Worksheet 4
Algorithmic thinking 2
Computational thinking and logic
Plenary
• Answer the following questions in a pair
• When data is compressed, if the compressed version restores
to exactly the same data is it lossy or lossless compression?
• Use the binary tree at the bottom of the slide to work out the
word represented by the following data:
00 10
1 0
1 11
01
01
0 0 1
0 1
1 0
0
Algorithmic thinking 2
Computational thinking and logic
Plenary
• When data is compressed, if the compressed version
restores to exactly the same data is it lossy or lossless
compression?
Lossless compression
• Use the binary tree at the bottom of the slide to work out the
word represented by the following data:
00 B 10 P BOOKKEEPER
1 O 0 E
1 O 11 R
01 K
01 K
0 E 0 1
0 1
1 0
0 E
Algorithmic thinking 2
Computational thinking and logic
Copyright
This unit and all the worksheets, PowerPoint presentations, teaching guides and other associated files
distributed with it are supplied to you by PG Online Limited under licence and may be used and copied by
you only in accordance with the terms of the licence. Except as expressly permitted by the licence, no part
of the materials distributed with this unit may be used, reproduced, stored in a retrieval system, or
transmitted, in any form or by any means, electronic or otherwise, without the prior written permission of
PG Online Limited.
Licence agreement
This is a legal agreement between you, the end user, and PG Online Limited. This unit and all the
worksheets, PowerPoint presentations, teaching guides and other associated files distributed with it is
licensed, not sold, to you by PG Online Limited for use under the terms of the licence.
The materials distributed with this unit may be freely copied and used by members of a single institution on
a single site only. You are not permitted to share in any way any of the materials or part of the materials
with any third party, including users on another site or individuals who are members of a separate
institution. You acknowledge that the materials must remain with you, the licencing institution, and no part
of the materials may be transferred to another institution. You also agree not to procure, authorise,
encourage, facilitate or enable any third party to reproduce these materials in whole or in part without the
prior permission of PG Online Limited.