All the listed projects were not related to schoolwork or done for a grade.

Lights Out Android App

My Lights Out app is based on the 1995 handheld electronic game by Tiger Electronics of the same name. In the 1995 version, the game board consists of a 5x5 grid of lights, and then when game starts, a seemingly random pattern of lights is presented to the player. The player's objective is to toggle lights to turn all the lights off with button presses, preferably in as few presses as possible.

When a light is pressed, the on/off state of the pressed light and all directly adjacent lights are toggled.

A board before a button press
A board after a button press

Although similar handheld games and apps already exists. There are two things that I believe make my app unique: variable board sizes, and mathematical optimization.

Variable Board Sizes

Many of the apps available today only feature a single board size, usually the classic 5x5. This makes the app less challenging once the user finds a reliable method for solving the single board size and limits the number of possible scrambles. For the 5x5 board, there are 223=8388608 distinct ways to create a scramble. However, there are at least 4 different ways to create any given scramble, leaving at most 219=524288 unique scrambles. All of these scrambles can be solved in at most 15 button presses.

My app allows user to play any board size from the trivial 1x1 to the daunting 10x10, providing orders of magnitude more unique scrambles than the 5x5 alone. I would have allowed even larges sizes, but the buttons were getting too small to reliably press.

Level selection
A scrambled 10x10 board

In fact, just the 10x10 size has 2100, over 1 nonillion unique scrambles. For comparison, if each unique board were printed on a sheet of paper 0.1 mm thick, the stack of paper would reach to the edge of the observable universe 13.4 billion light years away.

Users have yet another dimension opened to them in being able to play by only pressing buttons that are already on. Although all puzzles that can be solved normally can also be solved by only pressing on buttons, it makes for a much more difficult challenge because the way that most learn to solve the 5x5 board requires pressing off buttons.

Mathematical Optimization

I already mentioned how any 5x5 board can be solved in at most 15 button presses. Puzzle enthusiasts and recreational mathematicians like Jaap Scherphuis proved this to be the case. Jaap in particular uses a method of treating solving the board as a linear algebra problem that is described by mathematician Marlow Anderson and Todd Feil in their 1998 paper Turning Lights Out with Linear Algebra.

I implemented Andserson and Feil's method of row-reducing matrices modulo 2 to determine the minimum number of clicks needed to solve any given board. This way users can know how their solve is compared to the absolute best they could do.

The minimum for this 10x10 board is 42 clicks

Although this value is only one number on a screen, I think it provides valuable information to users about a given puzzle's difficulty and their own solving abilities that no other app has.

The app is currently available for free download on the Google Play Store. If you have an iOS device or would like to play on a PC, you can play an online version that doesn't have the minimum clicks implemented that I created using JavaScript. The Android Studio project, which includes the Java source code is available on GitHub.

Computer Vision Security Camera

This application started when my high-school engineering class had just moved into a larger building. It was common for expensive tools to get lost or stolen, so we needed a way to find these items and identify any culprits.

Although the new building already had some installed security cameras, there were still many blind spots, and footage could only be saved up to one week, meaning that if a tool were discovered missing after one week had passed, the traditional security cameras would not be useful in recovering it. My solution was to use Raspberry Pi's, which are small, cheap, and single-board computers, as "smart" security cameras. These devices would be cheaper and easier to install than traditional cameras, and they could be more easily moved to another location if needed.

My first goal was to cut down on the storage space needed for footage without sacrificing picture quality or other valuable information. My solution was for the smart cameras to record video only when they detect motion. This way, disk space wouldn't be wasted on recording hours of the exact scene, but would still catch thieves as they walked into view.

This method worked extremely well. In many cases, hours of video was cut down to mere minutes. However, changing lighting conditions throughout the day could add noise to the image that would be mistaken for motion. I decided to fix this problem by having a threshold for motion that could be calibrated and changed automatically throughout the day. However, I wanted to make sure thieves would still be recorded, regardless of the lighting conditions. This is where computer vision came to my aid. Using Python's OpenCV library, I searched the video feed for faces. If any faces were detected, a green rectangle would be drawn around the face in the video feed, an image of the frame containing the face would be saved, and the camera would wait to recalibrate until no faces were detected.

Security camera feed with green box around a face

Code for this project is available on GitHub

Personal Website

I created because I felt that my front-end development skills were lacking. Front-end development is taught (if at all) in most computer science curriculums as an afterthought. However, I believe that just as students are taught to make clean, legible, and well-documented code through comments and programming paradigms (like object-oriented), they should also be taught how to make clean, navigable, and intuitive front ends. After all, this is the portion of a product with which most end-users will interact. is meant to meet these design criteria and to be a place to talk about myself and my experience more in-depth than in a resume. I didn't use any hand-holding website builders: each line was written by me, with the help of documentation.

Version 2

Although the original version of my site was passable, the code was messy, images were difficult to deal with, and the website did not work well on mobile. With these issues in mind, I resigned the site to use Bootstrap to give the site a cleaner look and help in addressing mobile issues.

In the future, I plan on using JavaScript frameworks like React or Angular to build elements more quickly and cleanly. With all the text from all the projects on this page, the html file is many lines and can be difficult to edit.

Although you are already viewing the website, all the code is available on GitHub.

Math Summaries

While taking a summer physics class dealing with Maxwell's Equations, which are written in the language of multivariable calculus, I realized how much of the subject I had forgotten even though I took multivariable calculus class (Calc III) only nine months earlier. I also knew that several of my friends who would be taking Calc III in the coming semesters had already requested my advice about the class and for my notes, but I like to have my notes as a reference.

I decided to digitize my notes using LaTeX in a textbook structure: chapters with sections and sub-sections. I would also add better visual aids than my hurriedly-drawn sketches. This way, I could easily share clear and legible notes, keep the my original notes, and refresh my own understanding. By the time I was finished, I had condensed the several-thousand page textbook into an 81-page guide that still contained many visual aids and full-length proofs. I feel much more confident in my abilities, and I think my friends will be able to learn from me much more easily.

After completing my notes, I posted the results to r/math, an online community of math enthusiasts. To my surprise my post was incredibly well-received, and several users suggested open-sourcing my work so that others could help make corrections and suggest additions. The repo is available and has already taken several community contributions.

I've begun expanding the scope of the project beyond multivaraible calculus. I recently completed a 92-page summary of introductory differential equations, and I will begin working on a similar document for linear algebra. Due to user suggestions, I also plan on making a summary of single variable calculus.

Twitter Bad Words Bot

The specific words that people choose to use can provide insight into their background and character. Although reasonable people can vehemently disagree, a good indicator of mutual respect between two parties is that neither resorts to vulgarity. Inspired by other bots on platforms like Reddit and Discord, that could provide information on the language that users have used and play a part in keeping online discussion civil, I set out to create a Twitter bot that, when requested by another Twitter user, would provide information on vulgarities that users have recently tweeted.

I wrote the bot in Python, following basic online video tutorials that detailed how to work with the Twitter API through the Python library tweepy. Although these tutorials showed me how to detect when a user had @ mentioned the bot and how to respond to tweets, the real challenge and substance of this bot came from accessing another user's tweets, parsing through them to find bad words, and reporting the frequency of these bad words within the 280-character limit of a Tweet.

After finding separate answers on how to access a given user's tweets, I got to work on detecting bad words. Although I found several GitHub repos that contained lists of bad words, many were too comprehensive, marking even words with possible negative connotations, like the names of political parties, as bad. I eventually settled on a list of 444 common words collected by Google. This list was comprehensive enough to cover most bad word, and even common variations like swapping a letter for a number. On the implementation side, I took advantage of Python's built-in dictionary functionality to find matching bad words in a user's 100 most recent tweets and rank them by frequency.

For deployment, I settled on a free service recommended in one of the simple video tutorials, PythonAnywhere. I know that this solution is probably not best practice, and I still have issues regarding reliability because PythonAnywhere periodically updates their servers and does not restart any running scripts that were stopped. However, I struggled with trying to use other platforms like Heroku because I could not work out compatibility issues or find documentation detailed enough to fix issues.

The bot's Twitter handle is @BadWordCount. Go ahead and try it out on some of your favorite twitter users. The tweet shown above is from a movie starring Jason Bateman. The code that the bot is running is on my GitHub.

Linear Algebra Library

I originally started working on this project in high school to practice array manipulation in preparation for the AP Computer Science A exam. My main goal at that point was to be able to find the reduced-row echelon form of a given array of doubles, allowing me to solve linear systems of equations.

As my knowledge grew regarding object-oriented programming and the applications of matrices to structures like networks, so did this project. I added a "Vector" class where one could determine vector information (e.g., cross-product and dot-product) or use these Vectors to populate a Matrix. One major change I made was making the "Matrix" class generically-typed, with "BinaryMatrix" and "NumericMatrix" extending the Matrix class and adding additional data type-specific functionality. For example, a specific application of the BinaryMatrix class is the ability to represent and determine qualities (e.g., reflexive, transitive, trichotomous) of binary relations; the DoubleMatrix class can solve linear systems of equations like originally intended.

As my knowledge grew regarding object-oriented programming and the applications of matrices to structures like networks, so did this project. I added a "Vector" class where one could determine vector information (e.g., cross-product and dot-product) or use these Vectors to populate a Matrix. One major change I made was making the "Matrix" class generically-typed, with "BinaryMatrix" and "NumericMatrix" extending the Matrix class and adding additional data type-specific functionality. For example, a specific application of the BinaryMatrix class is the ability to represent and determine qualities (e.g., reflexive, transitive, trichotomous) of binary relations; the DoubleMatrix class can solve linear systems of equations like originally intended.

I also learned the importance of unit testing and code coverage. Currently, all fully-implemented classes have 100% method coverage, at least 90% line coverage, and all tests passing. I will continue to add more unit tests and maintain high coverage as I implement greater functionality.

Below is a recent coverage report. All concrete classes, except those in the graph package and NumericMatrix, have more than 95% line coverage. Classes in the graph package are not yet ready for a round of testing, and NumericMatrix may soon be deleted, depending on whether this library will support matrices of non-numerical values.

Eclipse coverage report of Linear Alebra library

In the future, I want to continue adding functionality for important objects in mathematics and computer science that are commonly represented as matrices. This includes items like Markov Chains and graphs. I am especially excited about developing weighted and directed graphs (digraphs) for applications like path finding and optimization.

Code and JavaDoc for the Linear Algebra library is available on GitHub.

Computer Generated Art

Visuals have always been an effective and fun way for me to learn, especially when the topic is abstract. The tkinker, turtle, and Pillow Python GUI libraries allow for simple image manipulation, down to the pixel level.

For example, the left image below visualizes how numbers change after a given number of iterations in the unsolved Collatz conjecture; it has been my phone background for several years. For a more artistic visualization, see the right image below, which applies a smeared watercolor effect.

Python-created image based on the Collatz conjecture
Python-crated image based on the Collatz conjecture with watercolor streaks

One can also visualize more useful and common mathematical ideas. The left image below shows how horizontal and vertical lines in the complex plane are transformed under e^(1/z). One can clearly see concentric cardioids. The right image below shows the graph of several common functions, like sine and the natural logarithm.

Python-created image of the complex mapping of e^(1/z)
Python-created image of graphed functions

The Turtle library allows one to trace out colored paths in an image, like the rainbow spiral no the left below. Getting a little more advanced, one can create recursive shapes, like the Koch Snowflake, Seirpinski Triangle, and dragon curve, shown below.

Python-created image of hexagonal rainbow sprial
Python-created image of Koch Snowflake
Python-created image of Seirpinski Triangle
Python-created image of dragon curve

One can also make other startlingly complex images from a simple set of recursive rules. The below images, known collectively as "strange attractors," show a tree, Barnsley Fern, pine branch and piece of tall grass. The procedural generation techniques used to create these images, known as L-systems, are used in many of today's popular video games to make random, realistic terrain and plants.

Python-created image of 30-degree binary tree
Python created image of Barnsley Fern
Python-created image of L-system resembling tall grass
Python-created image of L-system resembling pine branch

The images above and many others that I made in Python, as well as the code used to create them, are available on GitHub.