Posts

An exploration in number systems

For most people, the denary system of numbers is perfectly natural. So much so that people don’t even give other options a second thought. The alternatives are not just hypothetical but are in their own way ingrained in our culture. What is the denary system of numbers? Denary from the Latin decem for ten, is a system of numbers where we have 10 symbols 0 to 9. For this, we use a positional number system based on powers of 10. Each column to the left has a value 10 times that to the right. The number 1000 is: Thousands Hundreds Tens units 1 0 0 0 This isn’t the only system that could be used and in fact, 10 is special only in the sense that we have 10 fingers. If the number of fingers isn’t taken into account then base 12 would make arithmetic a lot simpler. Instead of a 10s column you have a dozens, instead of 100s you have 144s. For this you ofcourse need more symbols. 10 is represented with the symbol A and 11 is represented with the symbol B. 12 is re...

Simple repetition; yesterday's news

Image
Over the last year in lockdown, I’ve tried out a lot of little experiments, in an attempt at following my sister's mantra of a parcel a day keeps covid at bay we ended up with a lot of cardboard in the house. After my previous post, wondering about the strength of layers of cardboard I decided to try and make a rock formation that would act as a vertical planter. Starting with the cardboard I built out a ridiculous structure folding the strips of cardboard into triangular based prisms with the intent that this would allow for the most strength. Then after buying 5 litres of PVA glue off amazon and collecting as many evening standards as I could I covered the structure slowly in paper-mache. I spent far too many hours going over and over the structure in layer upon layer of paper-mache. I barely made a dent in my supply of newspaper which for all intents and purposes was an unlimited supply, nor did I make a dent in the 5 litres of glue. The structure took to a shape, not really ver...

Exploring development timing through building a simple trading game

Image
Exploring development timing through building a simple trading game One of the things I have struggled with in the past is creating accurate estimates for how long projects will take to complete. This is clearly something that expands with experience but by better analysing where I am going wrong, I believe I can steepen my learning curve. What was the project? The project on which I chose to explore time estimations was a simple trading game. In the game users start with a little bit of cash; £100 and have the ability to post bids and offers on a single stock. The server would then run a matching algorithm that would match compatible bids and offers and give both users the average of the bid and offer prices. The price at which each trade is carried out is then reported to a graph on the webpage, these are polled. Where the idea came from The idea came from a long train of thought which started with a virtual races betting with some friends. I got annoyed because the odds weren...

The lemon grove at the creperie: Maths behind economic intuition

Image
 There are a lot of things we have an intuition about in economics. If you haven't studied it you might not realise these often have a mathematical formalism. Two farms Take the following example I got from a blog   Having two farms that can be harvested in six months isn't equal to having one farm that can be harvested in three months and another that can be harvested in nine months. How do I take into account the amount of time involved? So intuitively there is a benefit from having a smaller output after a shorter time, but how do we quantify how much better it is? This is where a concept called discounting comes in. Discounting allows you to calculate the value of things based on how you value money now compared to in a years time. If I offered you £100 now, I'd not be surprised if you took me up on the offer. If, however, I give you a second option, I'll give you £x in exactly a years time. How much would I have to give you in a years time for you to choose to take...

But can't you just use integration on the arc length?

Image
 I recently came across the following video  It made me think surly this can be derived in the same way as one can derive the formula for a circle. I'd gone through that derivation a number of times at school and since the formula for an ellipse is so close thought the same approach would surly work for an ellipse. I decided to give it a go believing that I surely wouldn't get the answer I expected but it would be interesting to see why the arc-length method wouldn't work. At this point, if I had to guess I would guess that the impossibility lay in the issue with integration. The formula for a circle can be represented parametrically as: To adapt this to an ellipse one simply needs to add constants in front of each trigonometric function: The arc length of a line can be calculated by the following identity which follows from Pythagoras: Using this identity we can get a formula for s in terms of x and y. However, this is where the signs of the problem begin as to fin...

What is intelligence anyway?

I have before briefly mentioned a definition for intelligence that is useful to consider when investigating AI. I’d like to go deeper into what my understanding of intelligence is. I have a deep interest in understanding the fundamentals of intelligence, what is it really that allows humans to outperform machines that are by most measures far superior in their computational power. I discuss a lot with friends and colleges the facets of what they believe intelligence to be and what different elements mean. This search has not just led to a Masters in artificial intelligence but to look deeper to read numerous books on epistemology, a topic I believe was missing in my degree. Epistemology is the study of knowledge. By most measures of intelligence and especially in its colloquial use intelligence has something to do with knowledge. Epistemology is the school of philosophy dedicated to making arguments about what it means to know something. It goes a lot deeper into the topic than the qu...

Validating SQLalchemy

Image
I have used SQLalchemy for a few projects and one of the things that annoys me, not so much from the structure, but the effects of code inside strings. All code is text which is parsed, however, we have inside IDE’s and for me inside VIM the ability to see the syntax errors as we are coding. No such thing exists for the code inside the strings which specify the joins of the relations in SQLalchemy. For this project, there are some core things the program needs to be able to do. Discover the file which contains the table object mappings Look for relation strings in those objects Validate the syntax of those strings Check that tables/columns referenced are valid Maybe enforce a syntax styling rule The file discovery shouldn’t be too taxing; most SQLAlchemy projects have a single folder in which the table objects are stored and each table needs to inherit from an sqlalchemy declarative base object. I thought that this project would be a good opportunity to learn elements of Python’s AST m...

Popular posts from this blog

Greedy meshing in javascript

A world of joins

Sortis - A paper empire game