The team was tasked with creating a Python program to guide a robot through a maze to eliminate bugs and viruses. They used Bayesian probability to navigate, exploring locations least visited. The team also practiced cryptography techniques like Caesar, Vigenere and Transposition ciphers to decrypt clues. Tracking past movements could have improved efficiency. The program was effective but loading issues arose using the school network. Future practice cryptography problems from organizers may help teams.
1. Cyber Robot Challenge Written Report
USA – Charles County Maryland - Henry E. Lackey High School
Team Members
George Jenkins (Team Captain)
Nathaniel Dudley
Melissa Nelson
Mai-lin Quinto
2. Abstract
The student team was tasked with creating a Python program that would navigate a series
of computer-generated mazes through the use of “Network Defender” robot character. The
robot’s functions were to destroy “Benign Bugs” via collision and “Vile Viruses” by solving
unique cryptography puzzles. After completion of each maze, teams were tasked with navigating
the robot to a network exit. Additionally, team members recorded various numerical clues,
converted them to base ten if necessary, substituted alphabetic characters for numeric ones (A =
1, Z = 26), and unscrambled the resulting strings. Points were tallied based on the number of
destroyed Benign Bugs and Vile Viruses and correctly unscrambled clues. A twenty percent
bonus would be added into each maze’s total points if the robot exited via one of the network
exits. The team created the guiding code using Bayesian probability, lists, and for, if, and while
loops and practiced Caesar, Vigenere, Transposition, Polybius Square, and Public/Private Key
ciphers. The Caesar cipher involves shifting the characters of the alphabet a specified number of
times to encrypt the original text, or plaintext, into encrypted text. The Vigenere cipher utilizes a
series of Caesar ciphers based on the letters of a keyword. The Transposition cypher rearranges
plaintext based on the letters of a keyword. The Polybius Square cipher uses a five by five square
which letter correspond to the column and row which the letter is placed. The Public/Private
cypher manipulates numbers using algebra and modulo arithmetic. The Python program
developed was effective but adding the ability of tracking past movements would have increased
the efficiency of the robots movements.
3. Introduction
The team was tasked with creating a computer program using the programming language
Python that would guide a “Defender Robot” through a virtual maze in order to eliminate Benign
Bugs and Vile Viruses. The Defender Robot was able to defeat Benign Bugs without outside
assistance, but in order to eliminate Vile Viruses, it needed a human team of cryptographers to
encrypt or decrypt messages using the Caesar, Vigenere, Transposition, Polybius Square, and
Public/Private Key ciphers. A maze was cleared once all of the Benign Bugs, worth 1000 points
each, and Vile Viruses, worth 5000 points each, were destroyed. A twenty percent bonus would
be given if the robot left via the network exit. Additionally, numerical clues in various base
systems were placed at strategic locations throughout each maze. These clues had to be
converted to their equivalent base ten numbers and then to alphabetic characters. The letters were
then unscrambled into secret phrases worth 10,000 points. The team had to create nine programs
that would each let the robot navigate through a corresponding maze and a default program that
could be used in lieu of any of the programs.
Discussion
This was the third year the Henry E. Lackey MESA Team has participated in this
challenge. Previously, team members reviewed Python basics online and created a basic,
common “follow the wall” programs using for, if, and while loops. This method worked well
with the smaller, simpler mazes, but was consistently caught in limiting infinite loops in more
complex mazes. During the competition, team members compensated by changing the movement
pattern of the robots depending on the quantity of free spaces to the front, left, or right of the
robot depending on what side entrances the robot did not explore. This method was inefficient as
4. it required exit from a maze, code modification, and a full restart before accumulating any
additional points.
Last year, the two members of the team who had the most experience with Python and
other programming languages were designated “Maze solvers” and focused their efforts on
creating programs that would solve the mazes. The other two team members researched the four
different cryptography techniques outlined in the guidelines: Caesar, Vigenere, Transposition,
and Public/Private Key. The team met once a week to discuss progress and outline future plans.
This year, two members from the previous year (Jenkins & Dudley) were again able to challenge
this problem. A code-solving competition was held using provided practice problems and
solutions between interested MESA members to choose the third and fourth team members. The
two people who scored the highest amount of points in thirty minutes, Melissa Nelson and Mai-
lin Quinto, were chosen as the additional team members. Team member George Jenkins explored
alternative maze-solving algorithms with the help of Nate Dudley. Nate, Melissa, and Mai-lin
practiced solving ciphers.
Bayesian methodology, first outlined by Thomas Bayes, is a statistical analysis method
that assigns a hypothesis an initial probability, called the ‘prior’, collects evidence related to the
hypothesis, and recalculates the original probability, creating the ‘posterior’. The posterior
probability of the hypothesis is equal to the product of the prior probability of the hypothesis and
the conditional probability of the evidence given the hypothesis divided by the probability of the
new evidence. In application, this method allows the robot to categorically store information
about its previously visited locations and select its next move based on the number of times it has
explored each possibility using the formula where n is the number of previous visits.
Locations are stored using information from previous moves. For example, one move north
5. increases the Y-coordinate of the location by one and the storage list is updated accordingly.
Originally, the program kept track of which coordinates were not deemed valid locations and
excluded them from future exploration, but this approach prevented the robot from exploring
corridors, as walls are placed between grid squares instead of covering an entire square.
Orientation was updated after each move to ensure the correct sensing and movement commands
were implemented. The next iteration of the program used sensor commands to determine which
of the fourth directional moves were valid and then utilized Bayesian methodology to choose the
least-explored viable option. This iteration necessitated four instances of sensing and one turn
before each move was decided. To increase efficiency, Bayesian methodology was used to
choose a move before determining that move’s validity. Invalid moves were eliminated and new
moves were chosen and checked. Additionally, to ensure the robot wouldn’t get stuck in an
infinite loop, an element of randomness was added by multiplying the probability of moving to
each new square by a random number from zero to one before selecting the move with the
highest probability.
The cryptography techniques were researched using given guidelines and online
websites. The Caesar cipher involves shifting the characters of the alphabet a specified number
of times to encrypt the original text, or plaintext, into encrypted text. The Vigenere cipher
utilizes a series of Caesar ciphers based on the numeric equivalent of each letter of a keyword (A
= 1, Z = 26). For example, the keyword “CAB” (3, 1, 2) would shift the plaintext using a Caesar
Cipher with a key of 3, 1, and then 2. The Transposition cypher rearranges plaintext into n
columns, where n is the number of letters in the keyword, arranges the columns alphabetically
via each corresponding keyword letter, and rewrites the columns, from top to bottom, on a single
line. Polybius Square uses a five by five chart where each row and column is labeled with a letter
6. or number. Encoding consists of finding a letter in the chart and write the corresponding
coordinates, the row value, and then the column value. Decrypting simply uses the columns and
rows as coordinates, which you have to find the point, or letter in that particular sub-square. The
Public/Private cypher manipulates numbers using a series of algebra formulas and modulo
arithmetic. Conversion and unscrambling of numerical clues required only simple number
conversion practice.
Conclusion and Recommendations
The Lackey MESA Python Team utilized Bayesian methodology to solve a maze and
practiced solving Caesar, Vigenere, Transposition, Polybius Square, and Public/Private Key
Cipher cryptography problems. The program that guided the robot was efficient, but did not keep
track of which moves were valid from each location. Doing so would have further eliminated the
number of senses and increased the robot’s exploratory speed. Dividing code work and
cryptography practice and attending weekly meetings helped improve overall group efficiency.
The testing had to be performed on a home computer. The school network’s safety
mechanisms automatically shut down any .exe and so the challenge.bat software took over forty
minutes, on average, to load. Concentrated efforts with school officials may be able to alleviate
this problem. Additionally, team members had difficulty finding online practice cryptography
problems. It would be beneficial for future competition practice if specific cryptography
problems were provided by MESA officials. Overall, the team was happy with the performance
of the code developed and confident in their abilities to perform well on the cryptology elements
on the competition.
7. Bibliography
How PGP works. (n.d.). The International PGP Home Page. Retrieved March 12, 2013, from
http://www.pgpi.org/doc/pgpintro
Modular Arithmetic — An Introduction. (n.d.). Mathematics Department - Welcome. Retrieved March
12, 2013, from http://www.math.rutgers.edu/~erowland/modulararithmetic.html
SAS/STAT(R) 9.3 User's Guide. (n.d.). SAS Customer Support Knowledge Base and Community.
Retrieved March 12, 2013, from
http://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#introbayes_toc.htm
The Black Chamber - Caesar Cipher. (n.d.). Home. Retrieved March 12, 2013, from
http://www.simonsingh.net/The_Black_Chamber/caesar.html
Transposition Ciphers. (n.d.). Cornell Mathematics. Retrieved March 12, 2013, from
http://www.math.cornell.edu/~mec/2003-2004/cryptography/transposition/transposition.html
Vigenere Cipher. (n.d.). Computer Science. Retrieved March 12, 2013, from
http://www.cs.trincoll.edu/~crypto/historical/vigenere.html
can, t. c. (n.d.). Python 101 -- Introduction to Python. Rexx. Retrieved March 12, 2013, from
http://www.rexx.com/~dkuhlman/python_101/python_101.html
::: MESA - Maryland :::. (n.d.). The Johns Hopkins University Applied Physics Laboratory. Retrieved
March 13, 2013, from http://www.jhuapl.edu/mesa/events/mesaday/