Friday, May 16, 2008

a mathematical problem

i played a game on my iphone the other day. one that i am sure most people have played some variation of at the least. it consisted of a grid made up of 9 columns and 10 rows of marbles. there were four types of marbles displayed on the grid. the object of the game was to remove all of the marbles by discarding sets that contained adjacent, similar marbles. by clicking one of the marbles in such set, all marbles of the set would be removed from the board and the marbles above this set would fall to fill the void. the set of pictures shows this action in process for removing two such groups from the grid.

the challenge of the game exists in two forms. the first, and simplest, is removing all of the marbles form the board. with some forethought and a bit of luck, this can be done without too much trouble. however, while playing the game, i realized that at some point in the endeavour, there would be a point of no return where the game would be lost with no hope of winning. i thought that a mathematical approach to the task may provide a solution to the game everytime.

while i have not seriously pondered a solution to this idea, i do have several leads. i could assign each square a value to be differentiated from all others. the most obvious solution would be the cartesian plane. then, each variance of marble would be assigned a variable to group the marbles into their four classes. the last step (and the hardest) would be to devise a recursive formula that would run through all possible outcomes for the provided grid much like a chess program does to play a game of chess.

while i have never attempted such a thing, it is not beyond my means to do so. i have lightly contemplated the proposed program but have yet to sit down and produce a skeleton.

while playing the game some more after realizing that this could be solved with programming, i realized that the game also awards a score to the player which is the second challenge. this score is not just the result of how many marbles are left on the grid at the end of the game, but is strongly linked to the order in which the marbles are removed. deleting large groups is far more rewarding than completing the task of a clean grid.

this lead me to realize that my previous idea for an automatic solver could be further enhanced by figuring out the socring method of the game and incorporating it into the program. this algorithm could find two things: the solution that would yield the highest possible score with no concern of the number of marbles left and the solution that would allow for the largest score while ensuring a clean grid at the end.

i say all of this to say that i think i have a fun project on my hands. my biggest problem is that i have no means of programming right now. i have niethern server space for php or ruby (not that it would do me any good anyway since i know very little of either of those) nor any interface to code in C++ or C#. i can still accomplish my task in theory using pseudo-code even if i can’t actually create the engine itself.

i’ll post if anything ever comes of this. it may just be a fanciful thought that goes away.

Play the game here.

Posted by at 07:05:20 | Permalink | Comments (3)

Monday, April 30, 2007

a couple of wonderments

am i the only one that chews on one side of my mouth? i have noticed that i never use both sides when i eat. and i mean never. i was eating oreos tonight and i realized that i was using the left side. i decided (i actually had to stop what i was doing and think about it) to with my right teeth. and it felt really weird.


i also make a mess when i brush my teeth. i have been around people who will walk around the house doing other things while they brush their eating bones but not me. i have to stay glued to the sink so that the foam and saliva stays somewhat contained.


i was thinking the other day about what constitutes an island. i mean, the obvious definition is a land mass surrounded on all sides by water. and while i still believe that definition holds true in all cases, it’s not something we normally think about. for instance, the entire land mass of the americas is an island by definition. this includes south, central, and north america. it’s just not a concept that people generally accept because it is such a large land mass. but size of the land isn’t what determines what we label an island either. australia is 7,617,930 square kilometers (which is only about 2,000,000 less than the united states). it’s a big piece of rock down there but it is commonly referred to and thought of as an island. but it also has a name. and that was what i concluded. that the general public will consider a land mass an island when it can be singularily identified. the uk, madagascar, antarctica (which by the way is about 14,000,000 square kilometers), and japan all have identifiable names.


escher’s staircase is considered an impossibility in both the physical realm and in that of mathematics. you cannot have the relationship a < b < c < a. it cannot occur that way. as i was thinking about this, i came up with a real world example that contradicts this basic law: rock, paper, scissors. it is a game many of us play to settle small disputes or pass time. it relys on this circular balance for it’s rule set.

this made me think more about it and i also realized that a lot of governmental systems work best when this mathematical impossiblity is employed. having one branch of the government more powerful than all the rest means certain destruction. a healthy system will have all singular branches less than at least one other one.

on a small side note, you might be interested to find out that there is an international rock paper scissors society that compete yearly for the title of Rock Paper Scissors Champion. you can check out their website at World RPS Society.

Posted by at 21:59:55 | Permalink | Comments (2)

Friday, October 27, 2006

it’s a rainy day

rainy days are so dreary. more so for some than others but i think most people would agree that rainy days are not fun. i hate them mostly because i don’t like getting wet in clothes. there’s just something about having the formerly loose material sucked skin tight to my body, restricting movement, and making me heavier.

but it also makes people sleepy. i think that most people would agree that when it rains, they want to be lazy and just take naps or veg all day. i have a theory as to why this is so. the most common reason given to this phenomenon is the sound of the rain. when you are in a building and it is raining outside, most of the time you can hear the rain pounding on the roof. this sound just seems to make people not get out of bed because it instantly drugs them into sleep again. well i would remind you about pavlov’s dogs.

in case you’re not familiar with the experiment, this guy named pavlov decided to do an experiment with some of his dogs (hence the name). what he believed was that animals’ (which includes us) brains are triggered by environmental stimuli. to test this, he put some dogs in a room and would only feed them a certain way. before feeding them he would ring a bell. and that’s all of the important stuff. over time though, the dogs began to associate the ringing of the bell to them getting to eat. it got to the point that when he rang the bell, the dogs would begin to salivate even there was no food in the room at all.

we’ll get back to that in a second. my theory about us getting sleepy when it rains has to do with the pressure of the atmosphere. i might need to give you a little background on atmospheric pressure though. air has weight. it is minimal but when you have an atmosphere full of it, the numbers begin to add up. and think about it, above you is about 50 miles of air. gravity affects all things with mass and since air is made up of lots of tiny particles and each of those have mass, the air above you has mass and is being pulled down by earth’s gravitational pull. this amounts to atmospheric pressure. the farther you get away from earth, the less air there is because the majority of the air is being pulled down towards the surface.

another quick thing. air will fill up a space it is in but it is easily compressed as well. think of a balloon. the reason it keeps a uniform shape is that the air you are putting inside of it is trying to space itself out prefectly and is putting uniform pressure on the lining of the balloon. also, think of a room. if you put a little bit of air in there, you will have difficulty breathing because the air will be spread out and you will not be getting the oxygen you need. by puttin gmore air in (which will also increase the pressure in the room) you will be able to get the oxygen you need to breathe. this is because the oxygen is more condensed to to the hightened pressure.

so back to the rainy day. since it is caused by a low pressure front, i conclude that we get sleepy because there is less oxygen per cubic foot around us than we are used to. not getting the oxygen you need causes your body to get “sleepy”.

and pavlov’s dogs. i think that we have been conditionally trained that when we hear the sound of rain, our brains automatically associate it with being sleepy.

i think i think too much. i’m goingto kill some brain cells with a video game.

Posted by at 20:25:50 | Permalink | No Comments »