Posted in Science & Nature

Honeybee Dance

How do honeybees share the location of a food source, such as a flower, to other bees of their colony? An Austrian biologist named Karl Von Frisch devised an experiment to learn how the honeybees communicated with each other. He set up two different food sources and tagged every bee that came to pot A green and bees that came to pot B red. He then studied the behaviour of these bees back at the hive. What he discovered was fascinating.

For millennia, beekeepers have noticed that some honeybees have a tendency of moving in a peculiar yet methodical way once they returned to their hive after foraging for flowers. The bees would move in a straight line while waggling their bottom (moving side-to-side), then walk in a semicircle back to where they started. They would then waggle in the same direction, then move in a semicircle on the opposite side, completing a figure-eight path. This is called a waggle dance.

image

Frisch noticed that bees with green spots and the bees with red spots both did the waggle dance once they returned to the hive, but in different directions. All bees with green spots danced so that the straight line pointed a certain direction, while the bees with red spots danced the same dance except pointing another direction. Amazingly, the angle between these two directions was exactly the same as the angle separating pot A and B (with the hive as a point of origin). Frisch deduced that the waggle dance was the language of honeybees.

Through further experimentation, Frisch was able to tease out the details of this “language”.

  • Honeybees’ eyes can see ultraviolet and polarised light, which allows them to see where the sun is in the sky at all times. This is because sunlight polarises so that it points towards the sun and honeybees can see this direction. Therefore, the bee’s eyes act as a solar compass that tracks the exact location of the sun in real-time.
  • Bees have a finely-tuned internal clock that allows them to predict exactly where the sun should be depending on time, season and latitude, as the sun moves through the sky.
  • Another point of reference that is used in the bees’ language is gravity. Gravity is a constant that does not change, meaning all bees know which direction is “up” and which is “down”. This also means they can use a vertical, perpendicular line as a standard zero-point.

By pairing the two global constants, gravity and the location of the sun, the bees can accurately signal to other bees the direction they should fly in to find the food source. If a bee does a waggle dance that points 60° right from the vertical “up” direction (as defined by gravity), it signals that the bees should fly 60° right from the direction of the sun. If the angle is 0°, the bees should fly directly towards the sun, and if the angle is 180°, the bees should fly directly away from the sun. The bees use their internal clock to calibrate the direction depending on the time of the day.

The straight line “waggle” part of the dance gives the information of distance. The longer the duration of the straight line, the further away the flower is. As a general rule of thumb, the duration of the straight line increases by 1 second for every 1 kilometre. When the food is within about 60m of the hive, the 8-shape waggle dance turns into an O-shape round dance. The bee deduces the distance by the energy required to fly to the location.

By encoding the two variables “direction” and “distance”, a bee can effectively use the waggle dance to accurately pinpoint the location of a food source. It is amazing to see that animals that we consider “primitive” such as bees have such an intricate method of communication.

image

(Image source: http://aireona93.deviantart.com/art/YAY-Waggle-Dance-146361214?q=boost%3Apopular%20waggle%20dance&qo=1)

Posted in Science & Nature

Cryptography: Kasiski Examination

The Kasiski examination can be used to attack polyalphabetic substitution ciphers such as the Vigenère cipher, revealing the keyword that was used to encrypt the message. Before this method was devised by Friedrick Kasiski in 1863, the Vigenère cipher was considered “indecipherable” as there was no simple way to figure out the encryption unless the keyword was known. But with the Kasiski examination, even the Vigenère cipher is not safe anymore.

The Kasiski examination is based on the fact that assuming the number of letters of the keyword is n, every nth column is encoded in the same shift as each other. Simply put, every nth column can be treated as a single monoalphabetic substitution cipher that can be broken with frequency analysis. Ergo, all the cryptanalyst needs to do to convert the Vigenère cipher into a Caesar cipher is know the length of the keyword.

To find the length of the keyword, look for a string of repeated text in the ciphertext (make sure it is longer than three letters). The distance between two equal repeated strings is likely to be a multiple of the length of the keyword. The distance is defined as the number of characters starting from the last letter of the first set of strings to the last letter of the second set of strings (e.g. “abcdefxyzxyzxyzabcdef” -> “abcdef” is repeated” -> distance is “xyzxyzxyzabcdef” which is 15 letters). The reason this works is that if there is a repeated string in the plaintext and the distance between these strings is a multiple of the keyword length, the keyword letters will line up and there will be repeated strings in the ciphertext also. If the distance is not a multiple of the keyword length, even if there is a repeated string of letters in the plaintext, the ciphertext will be completely different as the keyword would not match up and be different.

It is useful recording the distance between each set of repeated strings to find the greatest common factor. The number that factors the most into all of these distances (e.g. 6 is a factor of 6, 12, 18…) is most likely the length of the keyword. Once the length of the keyword is found, then every nth letter must have been encrypted using the same letter of the keyword. Thus, by recording every nth letter in one string, you can obtain what is essentially a Caesar cipher. The Caesar cipher is then attacked using frequency analysis. Once a few of these strings (of different positions on the ciphertext) are solved, the keyword can be revealed by checking the shift key against a tabula recta (e.g. if a certain string of nth letters is found to have been shifted 3 letters each, then the corresponding letter in the keyword must be “D”, which shifts every plaintext letter by 3 in the Vigenère cipher). When the keyword is deduced, every message encrypted using that keyword can now easily be decoded by you.

Although the Kasiski examination appears to be complex, attempting to try it reveals how simple the process is. Thus, it is useful to try encrypting a message using the Vigenère cipher then trying to work out the keyword using the Kasiski examination. Much like the frequency analysis, it is an extremely useful tool in the case of needing to break a secret code.

Posted in Psychology & Medicine

Hedgehog’s Dilemma

Imagine two hedgehogs in the middle of winter. Even though they wish to huddle together to keep warm, they must keep distance to not become stabbed by the other hedgehog. There is no way they can avoid hurting each other without keeping their distance. Although both hedgehogs badly want to be close and intimate, they cannot. Therefore, the hedgehogs sacrifice the potential warmth for their own comfort.

Human relationships are just like the hedgehogs in the allegory. If a relationship is too close, the two people have a serious danger of hurting each other in one way or another. It is crucial to find the balance between keeping distance and having enough intimacy to have a good relationship, but much like the hedgehogs, this is a very difficult task. 

Some people may have the unfortunate experience of being pricked by another hedgehog and learn that getting too close hurts too much. These people try and keep their distance from other people and rely on their internal warmth to not freeze during the winter. This phenomenon is more pronounced in introverted people and clearly seen in those suffering from social anxiety.

This is the dilemma of the hedgehogs: should one sacrifice the warmth of companionship to avoid pain? Or should one overcome the potential pain to attain the intimacy that we all seek? Figuring out where the perfect balance lies and respecting each other’s personal space is quite possibly one of the most important factors in having a healthy relationship.