Sunday, March 14, 2010

Vertical and diagonal words

Unix systems often have a quite handy file called /usr/share/dict/words that contains almost 40,000 or so words for use by spell checking tools. It's sorted, and each word is separated by a newline. So it looks something like

aback
abaft
abandon
abandoned

etc.

On a random whim I set out to examine to what extent words existed vertically in this dictionary, using a quite ugly brute-force approach that tested a 1,081,332 character long string that was basically a concatenation of every single word in the dictionary for the 40,000 sub-strings that made up the dictionary, running for a minute or so.

Perhaps not surprisingly, there weren't a lot of these words. And in fact, the longest words were only five letters long; but in case someone wants to build a crossword puzzle or something, here is a list of those words:



adder
multistage
multitude
multitudes
multiuser
multivariate

doors
surged
surgeon
surgeons
surgery
surges

fills
mindfulness
minding
mindless
mindlessly
minds

fills
doubtfully
doubting
doubtless
doubtlessly
doubts

fills
fruitfulness
fruition
fruitless
fruitlessly
fruits

guess
amalgams
amanuensis
amaretto
amass
amassed

guess
resting
restitution
restive
restless
restlessly

hills
motherhood
mothering
motherland
motherly
mothers

noose
compactness
compactor
compactors
compacts
companies

sauce
samplings
sanatoria
sanatorium
sanctification
sanctified

sneer
assesses
assessing
assessment
assessments
assessor

steep
horseshoer
horticulture
hose
hoses
hospitable

stint
despising
despite
despoil
despondent
despot



Diagonally, though, is quite a lot more interesting. Not only are the words quite a lot longer, the diagonal word is almost always the same as—or very similar to—the last word, which is a semi-obvious consequence of sorting when you think about it.

The longest few I found were


differentiation
diets
differ
differed
difference
differences
different
differentiable
differential
differentials
differentiate
differentiated
differentiates
differentiating
differentiation
differentiations

representatives
repositions
repositories
repository
reprehensible
represent
representable
representably
representation
representational
representationally
representations
representative
representatively
representativeness
representatives

Tuesday, March 2, 2010

The supposedly herculean feats of ants

Most of us have heard that ants can carry weights hundred times of their own. Just recently, BBC News ran a story related to this ability.


Image Source: Wikimedia Commons.



In most people, this conjures up images of SUV-sized ants effortlessly lugging around buildings, reminiscent those in classic Sci-Fi film THEM!; more still, of mimicking the ants and creating super-strong materials and actuators that are vastly stronger than anything we have access to today.

This is however a pipe dream. This apparent strength is a consequence of being small, and not of some specific capability of ants. The villain is scaling laws -- the rules that describe how physical properties change with size.



Here is how it works:

The mass of an object that has characteristic length L (that is, is roughly of size L in height, width and depth) is described by m = ρL3, where ρ is the density of the object.

The weight a muscle can lift is given by Mmax = cL2, where c is some material constant that is independent of size. You can see why this is by realizing that this is very much like the strength of a string -- and making a string longer does not make it stronger, but making it thicker does.

What we are interested in is the ratio of these quantities (i.e. maximum carry weight over mass):
Mmax / m = c/(ρL)

Ignoring c and ρ as they are independent of size, a pattern emerges. If we put in a very small value of L--a very small characteristic length--this ratio becomes very large. If we put in a large L, it becomes small.

So, what does this mean? Well, the smaller the muscle, the more it can carry relative to it's own weight.


In conclusion:

An ant that is 1,000 times larger than it is weighs a billion times more, but is only a million times stronger, so it's strength to mass ratio decreases by a factor 1000.

A human that is 1,000 times smaller than it is weighs a billion times less, but is only a million times weaker, so her strength to mass ratio increases by a factor 1000.

Returning to the SUV-sized ants, such ants would not be able to support their own weight, let alone carry buildings around, and an ant-sized human would be stronger than anything it's own size.



this value is a bit larger than SUV-size, but correct in an order of magnitude ballpark sort of way.