Las ondas y los números complejos

En este artículo comento algunas de las cosas que se pueden hacer con números complejos. Hay dos formas de representar un número complejo: forma cartesiana y forma polar. Algunas operaciones con números complejos son más fáciles en forma polar y otras lo son en forma cartesiana, y este artículo se centra en la forma polar y en lo útil que es para hacer procesamiento de señales, que es un tema en el que estoy interesado últimamente.

Como bonus, para aquellos que hayan oído hablar de la Transformada de Fourier pero no entienden cómo funciona, este artículo puede servir de introducción. Ya hablaré de ella en más profundidad en otro artículo, y tal vez incluso despeje algunas dudas sin crear otras que las sustituyan :-)

Hala, pulsad en "leer más" para leer esta obra maestra de la literatura universal.

La fórmula de Euler

Cuando los matemáticos acababan de descubrir (o de inventar, según a quién preguntéis) los números complejos, enseguida se pusieron a mirar qué resultado dan las operaciones matemáticas habituales si se utilizan números complejos en lugar de números reales. Una de las expresiones cuyo valor querían saber era ei, y no tenían ni idea de cómo calcularla. Una cosa que a veces hacen los matemáticos cuando tienen un problema es buscar una versión más general del problema, resolver esa versión general, y luego aplicar la solución general al caso particular para obtener la respuesta al problema que tenían originalmente. Lo que hicieron los matemáticos en este caso fue intentar calcular el valor de eix.

Esta historia es básicamente una excusa para probar un script para insertar notación matemática en el blog, y de paso os explico de dónde viene la famosa fórmula de Euler. Si sois de esos que guardan la firme convicción de que las letras y los números tienen que permanecer bien separaditos, no la leáis. Si queréis ver cómo describo matemáticas de hace 300 años como si fuesen el último grito, pulsad en "leer más" y seguid leyendo.

Cómo explicar los números complejos

En realidad, los números complejos no son nada complicados, a pesar del nombre. Yo creo que el problema es el nombre de "números imaginarios", cuando no son más imaginarios que los números fraccionarios o los números negativos, y éstos se los enseñan a niños de ocho años.

A éstos se les enseña la suma diciendo que si Pepito tiene dos manzanas y recibe otras dos tendrá cuatro, y el producto diciendo que si quiere dar dos caramelos a cada uno de sus cinco amigos tendrá que repartir diez.

Yo creo que se puede enseñar los números imaginarios de la misma forma explicando, por ejemplo, que si Pepito quiere dar 2i caramelos a cada uno de sus 5i amigos, acabará recibiendo 10 caramelos. A mi me parece que éste es un ejemplo sencillo, intuitivo y fácil de entender. ¿No os parece?

(Comentarios en la correspondiente historia en Google+).

A brief history of old computers

It is impossible to tell when the first old computer was made because, as it turns out, all computers were new when they were made. Well, except, perhaps, for the original IBM PC, which already looked old back in 1981. Not everyone is of the same opinion, of course: some people say that it’s like the IBM PC had just arrived from the future, since every time you turned it on it would ask what today’s date was.

In the 19th century, Charles Babbage designed several mechanical calculators, one of which, the Analytical Engine, is considered a precursor to modern computers. Babbage approached the British government for funding, but after several years and multiple hearings it was never granted as Babbage was forced to admit that his machine couldn’t run Microsoft Office.

Modern computers are made out of transistors and integrated circuits, but that hasn’t always been the case. For example, in the 40s, electromechanical computers used the same type of relays that were used in telephone switches, and until the 60s, digital computers used vacuum valves. Nowadays, these vacuum valve computers are highly sought after by audiophiles.

Old home computers used audio cassettes to store their software, which could take a very long time to load. Sometimes people would put the wrong tape in the player, and depending on the type of music it could take them up to half an hour to realize their mistake. For a few years, computers could also store data in compact discs, but real enthusiasts preferred vinyl.

In the 80s, home computers could be programmed in the Basic programming language. Nowadays they can be programmed in any of several Complex programming languages.

It is true that old computers were slower than today’s, but they could perfectly do whatever tasks we asked of them at the time. At least right until the moment we used someone’s new computer and our old one suddenly became unacceptably slow.

I’ll finish this piece with an example that illustrates how technology has become more important and influential in our lives: in 1952 a UNIVAC computer was able to successfully predict the result of the US presidential election, and nowadays voting computers can determine the result of the presidential election. Who knows what the future may bring us?

(Comments in the Google+ post.)

A brief history of computer networking

Since time immemorial, humans have sought to connect their computers to exchange knowledge and to improve the mutual understanding of humankind. Of course, what they actually did with that was exchange porn, mostly.

A precursor to the computer networks was the telegraphy system, developed during the 19th century. It had many applications: apart from sending and receiving messages, you could buy and sell stocks, do money transfers, and other things that we think are so modern that we can do over the Internet nowadays. They didn’t have any need for an equivalent to Instagram, though, because back then all photos already looked vintage.

Computers were invented in the 40s, and they were so big and expensive that an entire University might have only one. To connect it to other computers, which could be thousands of miles away, they used telephone lines. As more computers were built and installed, new computer interconnect technologies were invented, because the computers kept calling each other and tying up the lines, and when the operators tried to get them to hang up they would complain: "but daaaad, I’m talking with Stacey, this is super important, you don’t understand me, I hate you."

The Internet became popular in the 90s. People expected that an ubiquitous global computer network would serve to exchange knowledge and improve the mutual understanding of humankind. Of course, in the end this marvel of human engineering and international cooperation was used to exchange cat pictures and porn, mostly.

At the end of the 90s someone said in passing, “hey, in the 19th century they had wireless telegraphy, why don’t we have wireless networking now?”, and some electrical engineers were so embarrassed by it that they went and invented Wi-Fi and then pretended it had existed all along.

Nowadays, thanks to digital convergence, we treat everything as just data, so our usages of the different communications networks are very mixed up. For example, we connect to the Internet at home through cable TV, browse the web on our phones, do phone calls on our laptops and watch TV over the Internet. At this pace things will become more and more mixed up and we’ll eventually do weird stuff like listening to music on the radio. Time will tell.

(Post your comments in the accompanying Google+ post.)

A brief history of time travel

Sometimes a thing is discovered or invented by several people at the same time. It happened to calculus, and it happened to the telephone. A theory says that those inventions or discoveries happen when the right set of circumstances align and the time is ripe. The time machine is another example of this: it was invented simultaneously in the years 8583, 6383, 4725, 3174, 1997, and 47 B.C.

Continue reading to see a full account of the history of time travel, all the way from the end to the beginning.

A brief history of personal computing

People think that personal computing is something completely new, and that PDAs, smartphones, and the like are recent inventions. However, the history of humankind is very long, and there are ancient precursors to very modern things. For example, since the dawn of time, humans have used their fingers to count, add, and subtract numbers, which is a clear example of digital computing. In addition, the ancient Sumerians are renowned for using tablets to write and do their bookkeeping, and the Romans used a stylus to write on a small handheld pad.

On popular sayings

I find the popular saying "When in Rome, do as the Romans do" pretty awkward. First, the word "do" appears twice in sequence, without the decency of at least introducing at least some alliteration. "In Denmark, do as the Danes do" would be way better, for example. Then, the saying doesn't rhyme, and everybody knows that popular sayings must rhyme. "When in Rome, do as the Romans do at home" improves a lot on it. But this brings the third problem: there is no rhythm to the saying. It's awkward to say. And moreover, the second part of the sentence has way many more syllables than the first. Imagine you are the first person to hear the saying. The speaker says "when in Rome", and you think "ah, this saying is going to be short and sweet, look how few syllables there are, only three", and then he says "do as the Romans do" and you go "whoa, that was 6 syllables. Stop a minute there. Don't recite the whole book at me".

Also, why the Romans especially? The Romans did lots of things we shouldn't really do anymore. For example, they held slaves. Imagine using this saying to justify slave ownership. "Why are you beating me up?" "We are doing as the Romans did. Now, what's your name?" "Kunta Kinte!" "Oooooh you cheeky person of color. You are lucky we aren't doing as the Greeks did."

I think that the Spanish version of this saying is way superior. "Donde fueres, haz lo que vieres". Which means "wherever you go, do whatever you see". See, it does rhyme. The first part is 4 syllables long and the second one is 5. And it doesn't involve Romans at all. Also in its favor, it uses an obsolete tense of the subjunctive mood, which is a plus in my book even though it makes it harder to translate into English, and if someone were inventing this saying today they would say "donde vayas, haz lo que veas", which would drive the actual inventor of the saying into remarking that using "vayas" assumes you are going somewhere, while "fueres" doesn't imply that you are going anywhere, but in case you ever go, do whatever you see (again, not assuming you are going to see anything). That guy is a smartass, but we already knew that because he decided to use the future subjunctive, which nobody does anymore, as I said before.

But at any rate, I like very much the Galician version, transmitted to me by my father, and so on since time immemorial, I assume. Or perhaps he made it up last year, but I'm not going to ask him and risk ruining the story. That version is "na terra dos lobos hai que ouvear como todos", which can be translated as "in the land of wolves you must howl like everyone else". It is an awesome saying because it has wolves in it, it rhymes, and even though it has two more syllables in the second part, it doesn't matter because you are so transfixed by the idea of howling like a wolf that you don't notice. And it creates a very graphical image in your mind about what it means, which is great in a popular saying. So I give it the full five stars and my seal of recommendation.

(Post your comments in the Google+ post for this story).

1-star Amazon reviews

0 of 70 people found the following review helpful
Shallow and pedantic, October 12, 2011
By Captain Munch (Oregon) - See all my reviews
This review is from: Doritos Tortilla Chips, Nacho Cheese, 11 Ounce (Grocery)
This is the worst book I've ever read. The plot is linear and predictable, the characters are flat, and the setting is badly researched. Apparently this is the author's first novel-length book. Hopefully it will be the last.

14 of 14 people found the following review helpful
They are HEAVY!, January 3, 2013
By Bargain Hunter - See all my reviews
This review is from: Vinyl Dumbbells 10lb - Pair (Misc.)
Today I was sitting in my rocking chair at the porch when Pat the mailman arrived, and he gave me a very dirty look as he handed me my Amazon package. I soon found out the reason: this item is HEAVY! No really! It had to weigh at least 20 pounds! No wonder Pat was so grumpy.

I think Amazon should give you a warning or something, it is very irresponsible of them to sell such heavy things without telling you beforehand.

235 of 392 people found the following review helpful
It's OK, but..., March 24, 2009
By Alice Wonders (Nevada) - See all my reviews
This review is from: Dremel 4000 Rotary Tool (Tools & Home Improvement)
I received this Dremel brand rotary tool today. It works really well. Only giving it 4 stars because the box it came in was a bit scuffed in a corner.

UPDATE 1-12-2013: Reduced to 1 star because it broke down after only four years of continuous use grinding granite and titanium alloys. You'd think Dremel would make better tools.

89 of 92 people found the following review helpful
The author didn't research the subject, April 2, 2013
By Natalie Blood (New Jersey) - See all my reviews
This review is from: Dracula by Bram Stoker (Hardcover)
Almost as soon as you pick up the book you know that it's going to be bad. The characters spend the whole book writing letters to each other and there's no action to speak of.

There are lots of anachronisms. For example, it is set in the 1800s but Mina types her letters and Dr. Steward records his voice. Hello! Everybody knows that there were no computers in the 1800s! Can you be more stupider than that?

Also, the book gets everything wrong about vampires. I think the author should have done some reading on the subject before writing the book.

(Post your comments on Google+.)

La ley d'Hondt y las mayorías (y las minorías)

Una característica del sistema d'Hondt que os expliqué ayer es que, aunque genera repartos proporcionales, tiende a favorecer a los partidos mayoritarios. Es decir, tiende a otorgar los escaños "sobrantes" primero a los partidos más votados. Esto puede causar problemas si se combina el sistema d'Hondt con un sistema electoral por circunscripciones (como el de España). En este caso, esta pequeña ventaja se magnifica.

Por dar un ejemplo bastante extremo, imaginad que tenemos un parlamento de 30 escaños y 2 partidos; uno recibe el 52% de los votos y el otro recibe el 48% de los votos. Si se reparten los 30 escaños en una circunscripción única, el primer partido recibiría 16 escaños y el otro partido recibiría 14. Sin embargo, si el territorio estuviese dividido en 10 circunscripciones de 3 escaños cada una, y en cada circunscripción cada partido recibiera el mismo porcentaje de votos que antes, en cada circunscripción el primer partido recibiría 2 escaños y el otro partido recibiría 1; en total, el partido ganador recibiría 20 escaños y el perdedor, 10.

Por supuesto, en España cada circunscripción tiene un número de escaños distinto, y los porcentajes de votos varían, pero el principio es el mismo, y explica por qué el partido más votado suele llevarse un porcentaje de escaños muy superior al porcentaje de votos que recibe en el territorio nacional.

Esto no significa que el sistema de circunscripciones sea malo per se. Este sistema tiene la ventaja de que posibilita que un partido que tiene mucho empuje en una provincia obtenga representación aunque su porcentaje global de votos en el territorio nacional sea bajo. El inconveniente (tiene que haber un inconveniente; no existe ningún sistema totalmente justo) es que los partidos que reciben un porcentaje bajo de los votos en todas las circunscripciones suelen recibir una proporción de los escaños inferior a la proporción de votos recibidos.

Para solucionar este problema, en algunos sitios utilizan un sistema d'Hondt modificado para favorecer ligeramente a los partidos minoritarios. Este sistema está modificado de forma que el primer escaño sea más fácil de obtener, por lo que un partido que no tenga ningún escaño tiene más posibilidades de recibir un escaño que uno que ya tenga varios. Esto se consigue haciendo que cada escaño después del primero cuente doble. Es decir, al hacer la tabla que describí en la historia de ayer, en lugar de dividir los votos entre 1, 2, 3, etc., se dividen entre 1, 3, 5, etc.

1 1000 900 700 400
3 333,3 300 233,3 133,3
5 200 180 140 80
7 142,9 128,6 100 57,1
9 111,1 100 77,8 44,4

La tabla anterior os muestra el mismo ejemplo de ayer, pero utilizando el sistema d'Hondt modificado. El número de escaños asignado a cada partido es el mismo que antes, pero lo importante es que se asignaron en distinto orden. Mientras que ayer el partido D no recibió su escaño hasta el sexto turno, hoy lo recibió de cuarto, justo después de que A, B y C recibieran los suyos. En otras palabras: si sólo hubiese cuatro o cinco escaños en juego, hoy D habría recibido uno, y ayer no. En un sistema de circunscripciones, por lo tanto, y suponiendo que en cada circunscripción la situación fuese similar, la representación de D sería más alta que con el sistema d'Hondt "puro".

Y esto es todo lo que tengo hoy sobre el sistema d'Hondt. Espero que os haya resultado interesante. Si queréis dejar comentarios, id a la correspondiente historia en Google+.