# Seven Kings High School presents…

Document Sample

```					     Seven Kings
High School presents…
After the first video conference…

We went back to our classrooms and
decided to :
Look at the Caesar shift,
Look at the frequency of the letters,
Look at Binary codes and then
 Make our own codes.
Here are the results…
Frequency
Frequency graphs for the English
text…
We found a small article in English
from a newspaper and analysed the
frequency of each letter.

We could then compare these
results with the results from the
frequencies from the codes.
After receiving the article, the
students involved in the maths
conference split up the piece of
text into equal sections and
recorded the frequencies of the
letters for their passage.
We then put all the
frequencies from all the
divided text together and
presented them in a table on
excel.
We totalled the frequencies and used
excel to calculate the percentages of
how frequently each letter occurred.

For example, the frequency of “A” in
the passage is 109.

The total frequency was 1105.
The person in charge of this graph
then presented a bar graph showing
the frequency of each letter in the
small paragraph of English.
Here is the frequency table
followed by the graph:
Letter   Total Percentages
c          28         2.534
Letter   Total   Percentages
w          30         2.715
q            0            0.000
d          32         2.896
z            0            0.000
g          34         3.077
j            1            0.090
l          35         3.167
x            1            0.090
r          60         5.430
k           11            0.995
n          68         6.154
m           13            1.176
o          69         6.244
v           13            1.176
h          78         7.059
y           15            1.357
i          80         7.240
b           22            1.991
s          89         8.054
f           23            2.081
a         109         9.864
p           23            2.081
t         117        10.588
u           26            2.353
e         128        11.584
c           28            2.534
Total    1105
Here is a bar graph showing the percentage of how
Here is a bar graph showing the percentage of how frequent each letter occurs in a small paragraph
frequently each letter occurs in the small paragraph.
14.000

12.000
The percentage of how frequent each letter occurs

10.000

8.000

6.000

4.000

2.000

0.000
a b c
A B C D E Ff G H Ii
d e    g h                    Jj   K L M N O P p Qq Rr
k l m n  o                        S Tt U V W X Yy Z z
s    u v w x
Letter

Letter
The graph shows that E & T will be
the most frequent letters

and

Q & Z will be the least frequent.
We changed the bar chart so
that the percentages were in
order starting from the
smallest.
Here the bar graph showing the percentages of the
Here is a bar graph showing the percentage of how frequent each letter occurs in a small paragraph
frequencies of each letter in order.
14.000

12.000
The percentage of how frequent each letter occurs

10.000

8.000

6.000

4.000

2.000

0.000
q   z   j   x   k   m    v   y    b   f   p   u    c   w   d    g   l    r   n   o   h    i   s      a   t   e
q z     j   x k m v y b               f            w
p u cLetter d g           l   r n      o h I        s a        t   e
Frequency Graphs for the
coded text…
We worked out the percentages of
the frequencies of the letters for
each of the four codes
C         C         C       C           C         C       C       C
1         2         3       4           1         2       3       4

L   %     L   %     L   %   L   %       L   %     L   %   L   %   L   %

G       0 D       0 F   1.1 I       0   B   3.3 X     3.1 Z   3.9 F   2.4

I       0 K       0 U   1.1 S       0   M   3.3 H     3.9 A   4.4 Y   2.4

Q       0 M       0 Y   1.1 Z       0   Z   4.2 Y     4.2 H   4.4 P    3

W       0 W       0 J   1.7 H   0.6     S   4.6 L      5 L    4.4 U    3

X       0 T   0.4 T     1.7 E   0.9     K       5 E   5.8 N   4.4 A   5.2

F   0.8 O     0.8 O     2.2 G   0.9     O   5.4 U     5.8 Q   4.4 J    7

E   1.3 C     1.5 W     2.2 T   0.9     P   5.4 V     5.8 P    5 X    7.6

D   1.7 I     1.5 B     2.8 K   1.5     U   6.7 F     6.2 I   6.1 Q   8.2

N   1.7 P     1.5 C     2.8 O   1.5     Y   6.7 A     6.6 M 6.1 B     8.5

C   2.5 S     1.9 E     2.8 V   1.5     H   7.1 B     6.6 X   6.1 N   9.1

J   2.5 Z     2.3 G     2.8 D   2.1     V   7.9 N     6.9 D   6.6 R   9.4

R   2.5 Q     2.7 K     2.8 L   2.1     A   12.1 G 9.3 R      7.7 C   10

T   2.9 J     3.1 V     2.8 M   2.1     L   12.1 R    15 S    8.8 W   10
We could then draw the bar graphs.
Here is the bar graph for Code 1
Here is a bar graph showing how frequent each letter occurs in the first code

14.0

12.0
Percentage of how frequent each letter occurs

10.0

8.0

Series1

6.0

4.0

2.0

0.0
G
G   I Q W X F E D N C J R T B M Z S K O P U Y H V A LL
I Q W X  F E D N C J R T B M Z S K O P U Y H V A
Letter
LETTER
Comparing the two – similarities and
differences
In the first code, the bar graph shows
that “L” is the most frequent letter.

This means that it is more likely for the
letter “L” in the first code to be “E”
because the frequency graph for the
paragraph in English showed that “E”
was the most frequent letter.
Here the bar graph for frequently
Here is is a bar graph showing howCode 2 each letter occurs in the second code

16.0
Percentage of how frequent each letter occurs in the second

14.0

12.0

10.0
code

Series1
8.0

6.0

4.0

2.0

0.0
D K M W T
D K M W T O C II P S Z Q JJ X H Y L E U V FF AA B B NN G R
O C    P S  Z Q   X H Y  L E U V              G R
Letter
LETTER
In the second code, the bar graph
shows that “R” is the most frequent
letter.

This means that it is more likely for the
letter “R” in the second code to be “E”.
Here is a bar graph showing for Code 3
Here is the Bar Graphthe frequency of each letter in the third code
10.0
Percentage for how frequent each letter occurs in the third code

9.0

8.0

7.0

6.0

5.0                                                                                                 Series1

4.0

3.0

2.0

1.0

0.0
FF UU Y Y J J T T QO W B B CC EE GG K K V V Z Z A AH H L LN NQ QP PI
W                                                 M MX X D DR R S
I                 S
Letter
LETTER
In the third code, the bar graph shows
that “S” is the most frequent letter.

This means that it is more likely for the
letter “S” in the third code to be “E”.
is the Bar Graph for of each letter
HereHere is a bar graph showing the frequency Code 4in the fourth code
12.0
Percentage of how frequently each letter occurs in the fourth

10.0

8.0
code

6.0                                                                                                            Series1

4.0

2.0

0.0
I   S   Z   H   E   G   T   K   O    V   D   L   M   F   Y   P   U   A   J   X   Q   B   N   R   C   W
I S Z H E G T K O V D L M F Y P U A J X Q B N R C W
Letter

LETTER
In the fourth code the bar graph shows
that “W” or “C” is the most frequent
letter.

This means that it is more likely for the
letter “W” or “C” in the fourth code to
be “E” or “T”.
All four graphs had roughly the
same shape.

We used the results of our
frequency analysis to help us to
crack the 4 codes.
 Code frequencies compared with the English
frequency
 The most frequent letter in code 1 is L and
the most frequent letter in English is E. In
code 1, L is E so code 1 follows the graph data.
 The most frequent letter in code 2 is R and
the most frequent letter in English is E. In
code 2, R is E so code 2 follows the graph
data.
There are two codes in code 3. The
most frequent letter in code 3 is S and
the most frequent letter in English is E.
In code 3, S is O in the first code of
code 3 so the frequencies in English and
code 3 do not correspond with each
other. S is T in the second code of code
3.
Again, the frequencies do not
correspond because the most frequent
letter in English does not equal the most
frequent letter in code 3. Code 3 does
The most frequent letter in code 4 is W
and the most frequent letter in English
is E. In code 4, W is N so code 4 does
not follow the graph data because W
does not equal E.
Top tips for deciphering any code:

As our studies in frequency analysis
have shown, one way to crack a code
is to tally the frequencies of the
different characters and work out
which is the most frequent letter.
As the most frequently used letter in
the English language is E, this is
probably that character.

The next most frequent character will
be T or H.
If the characters are still grouped
in their natural form, then look for
recurring patterns of small groups-

 these will probably be ECWs *
 words like “the” or “and”.

*extremely common words
Other members of our group used
the Caesar Shift to crack the code.
We used the same coded text that
we used for the frequency analysis
which was taken from the website
Motivate Maths.

The code was quite hard to crack,
but we managed it in the end.

This is how…
We used 2 strips of paper with the
alphabet written on each one.
One of the strips was stuck to the
table.
The second strip was not stuck
down as that strip would need to be
moved around.
This system is known as the Caesar
shift.
• We looked for words in the text
which had only two or three
letters as that would be a good
start because they would be easy
to check.
• For example, if we had A and F
together, we would know that it
could only be a small word like “it”
etc.
• We then found the letter on the
movable strip and put it against the
top strip which was stuck to the
table.
If we put the letter A next to the
letter I then the letter F will
automatically be next to the letter N.

If this works out to be correct, we
can stick the movable strip down to
the table in that position and we will
be able to crack the code for that
piece of the text.
Using this method we were able to
crack the codes.
We found that the 1st code was
the easiest to crack.
Codes 2 & 4 were more difficult
as letters were grouped in fives
rather than actual words.
Code 3 appeared to change the
shift half way through.

 Code 1 Each letter had moved on a shift of 7
 We will attack at dawn. Legions X and XI
should move round to the right under the
cover of darkness to attack the enemy from
the rear. Legions II and IV should move round
to the left under the cover of darkness to
attack the enemy from the left. Legions VII
and IX will start the attack from the front.
Code 2 Each letter had moved on a
shift of 13 places.
We have been betrayed there are spies
in our midst. You must search
everywhere and everyone. Find out who
is passing on all our plans to the enemy.
When you find the traitors make sure
they tell you all they know. If they can
be turned so that we can pass on false
information they may live otherwise
they will die.
Code 3 T The code moved on a shift of
22 & then changed to a shift of 1

The Queen will be travelling from
London to York next week. She is due to
leave on Monday at first light. She will
be accompanied by armed troops.
However this is our best chance to kill
her. Send your best men. They must not
fail.
Code 4     Each letter had moved on a
shift of 17 letters
 Send word to all your spies the King needs
information urgently about the intentions of
his brother in France. Where is he going. Who
is he meeting. What is he planning to do on his
return. The King knows that his brother is
planning against him and that he will stop at
nothing to bring him down. For this reason it is
vital that we discover as much as we can about
what Philip is doing so that we can prevent the
success of his plans.
Codes using binary systems

This the decoded version of the
binary code.

 This sentence has been coded
using the ASCHI system and binary
numbers.
This is a code that we were set to
decode by working out what the binary
numbers totalled to.

We were provided with a sheet that
told us what the binary numbers stood
for and the denary that they
represented.
For example: -
capital numbers – 65 to 90,

lower case – 97 to 122,

spaces – 32, full stops – 46, etc.
After filling in the sheet we
started looking at the binary code.
Then by matching up the total
binary number to the denary
number on the sheet we worked out
where the spaces were in the text.
From there we worked out the
letters from the beginning to the
end.
Finally we worked on devising our own
code.
Here are our messages using
our own codes –

Try to decipher them!
Message 1

0001 0101 001T 00UH 00K0 0S01
0E01 0B0D 0FR1 001L 0001 00Q0
011Z 0MS1 001G 0PVX 0Y01 0NC1
01WT 01ZP 001A 0UQ1 0111 0101
001K 0JF0 0KZH 0R00 0D00 0101
0E1E 001A 0111 0R0V 01JE 011L
0100 00X0 0010 0AB0
Message 2
PVKITBCDKH, ILUIFFITUI GTB
AHHAVJQTKJS. JDKC KC AQV
MAJJA GJ CIXIT YKTWC DKWD
CUDAAF. EI NIFKIXK KT PGKVTICC
GTB IOQGFKJS PAV IXIVSATI. JDKC
CUDAAF KC G MQFJKUQFJQVGF
CAUKIJS GTB IXIVSNABS DIFHC
IXIVSATI IFCI AQJ.
Good Luck!

```
DOCUMENT INFO
Shared By:
Categories:
Stats:
 views: 5 posted: 12/1/2009 language: English pages: 56
How are you planning on using Docstoc?