Professional Documents
Culture Documents
Analysis
Background
The aim for the project is to provide a resource for maths teachers do a game theory project with
their students. Despite game theory not currently being on the national syllabus in the UK, this
system would fill a need for a longer-term project to stretch more able students to improve their
problem-solving skills. The system would specifically be using the game Nim. There are many
variations of this, but for the purposes of this system there are multiple groups of stones, and on
one’s turn one can take 1, 2 or 3 stones from a single pile, and whoever takes the last stone wins.
The number of stones in each group would be variable and the students would be able to play either
against each other on different computers on the same local network, or against perfect AI, or watch
AI vs AI, with the purpose being for them to attempt to understand how the strategies work. The
system will allow teachers and students to register separately, with students tied to a specific class
or teacher. Their details will be stored in a database which will be checked for correct username and
password whenever they log in. On entry to the website there is a welcome page showing global
and class leaderboards, a game history for that specific user, and all other logged in users for their
class. They then have the option to either play with another logged in user in their class, to play
against the AI, or to watch AI vs AI, to understand how the strategies work. At the end of the game
the program will display a win screen or loss screen with an animated change of rating for students
to be able to track their progress. Users can then return to the home page or log out. Teachers can
log in and see their class leaderboard and see which students have beaten the perfect AI for each
number of stones, so that they can tailor their lessons towards learning strategies for certain number
of stones or helping specific students who are struggling. My end user is Neil Pickup, a Maths
teacher at the Dragon School, Oxford, who often uses long term projects for his abler students,
especially in a post scholarship exam group at the end of Year 8 where there is more opportunity for
extension.
The user will need no advanced IT skills, just ability to run the Python file. The web interface will
be user friendly. They will need Python3 with the following modules installed:
Flask
Flask_WTF
WTForms
Flask_SocketIO
SQLite3
I encourage them to try and think critically and reverse engineer problems, going beyond the
curriculum to learn new areas of Mathematics.
I tend to use longer term projects for all of my classes but the system would especially be for
intelligent Year 8 students post-scholarship exams in order to stretch and challenge them before
their move to their next school. In the past I have done some game theory projects with them
including games such as the Prisoner’s Dilemma. Ideally the system would be formatted so that
parameters can get more advanced and the strategies more involved over a number of lessons.
In the past with game theory projects, the most important thing for me has been the ability to log in
as a teacher to view my students’ progress and see how their strategies change over the course of a
number of lessons. In the case of your project, this could be seeing students’ rankings and who has
beaten the perfect AI.
A perfect AI would be very useful for the students to be able to see what strategies to use and how
to adapt that to a different number of stones. Ability to watch perfect AI vs perfect AI would also be
helpful for them to see whether the first or second player has the advantage with a given number of
stones. I think easier AI which remove stones at random or deliberately choose worse moves could
confuse students if they are trying to understand the best way to play the game, as it makes no sense
for the AI not to do the obvious move in certain situations.
A hint button could be useful once per game to help them if they’re feeling stuck and frustrated. I
would also want them to be able to compete against one another and track their progress.
IPSO Information
Store None
The primary problem with this system is that there is no ability to log in. This in turn means that
there is no ability to track your progress, no ability to play online against other players, and teachers
cannot log in to track their students’ progress. Furthermore, there’s no ability to choose to go first or
second against the AI, so it is more difficult to understand the way to beat the game.
The flowchart for how the website processes the game is shown below:
Fin Brickman
The program will be in Python 3 in order to facilitate use of Flask and SQLite3 modules and will be
coded in Visual Studio Code.
Objectives List
1. Ability to register
1.1 Choice between registering as student or teacher
1.2 Validation of email addresses
1.3 Verification of password
Fin Brickman
1.4 Checking uniqueness of email addresses
1.5 Checking uniqueness of username
1.6 Checking username is not too long
1.7 Checking that username field is not empty
1.8 Checking that name is not too long
1.9 Checking that name field is not empty
1.10 Ability for teacher to choose institution code
1.11 Checking that institution code is unique
1.12 Checking that institution code is not empty
1.13 Checking that institution code entered by student matches current institution code
1.14 Appropriate error message displayed
1.15 Clear form if an error is present
1.16 Database is updated with new teachers and students
1.17 Passwords are hashed when inserted into database
2. Ability to log in
2.1 Error message if username/password are incorrect
2.2 Form is cleared if error message is displayed
2.3 If the correct username and password are entered, the user is added to the list of logged
in users
2.4 If username and password are correct the welcome page is displayed
6. Processing result
6.1 The winner gets a win screen
6.2 The win screen animates rating increase for player vs player
6.3 The loser gets a loss screen
6.4 The loss screen animates rating decrease for player vs player
6.5 Statistics table is updated in database
6.6 Button to return to home screen or to log out are displayed