Csp

Optical Character Recognition

OCR

This was one of the first times I fell in love with Machine Learning, without knowing that the magic came from Machine Learning methods.

I simply had a `pdf` file with handwritten or scanned text, and desperately wanted to find something within the document without having to do it manually.

I google online for an OCR; upload my file; download it back again, and hey presto — such magical, accurate results!

Read more >

Peg Solitaire

Personal Motivations

I grew up as a child with this puzzle in my house. My mother could solve it, along with a couple members on her side of the family.

Mum never knew the algorithm, nor any techniques beyond "My hand just knows"; as a result I spent 4 determined days in my youth working it until I had solved it.

/projects/csp/peg-solitaire/
coffee-pegs.jpg
the one on my own coffee table

During these 4 days, I learned a heuristic: to consider the L shape `___|` and realise that for every such set, you can perform legal operations until you are left with a single marble. Then, since there are 32 marbles, you can do this 8 times until you have 4 remaining, and finally perform this "L-trick" one last time til a single peg remains in the middle of the board.

Read more >

Tools

I am using this project as an excuse to learn GO.

Each heading below is a tool I have produced, the Go code is tangled into a repository called 100 Days of Go and repurposed at tools.abaj.ai — which serves these convenience mathematical and programmatic tools in a nice frontend.

The Table of Contents is your friend.

Primality Checker

Nth Fibonacci Number

GCD

LCM

Base Changer

Train Game, Get 10

This is just Python write up of a game that we used to play (and I still do), as a child on the NSW trains:

Given a series of 4 numbers (the train carriage identifier), we were tasked with constructing the number 10 using mathematical operations.

Say our carriage number was: \[\require{bbox}\bbox[lightblue,5px,border:2px solid red]{\color{#800000}{ 6325 }}}\]

Then one valid configuration would be \(6-3+2+5\) which equals 10.

Today I am going to write some Python code to replicate this functionality and test 4 digit sequences that can make 10 using permutations of +-x/^%!.

Read more >