Sunday, 9 November 2014

Dividing by zero.

DO NOT DIVIDE BY ZERO!



Unless you're Chuck Norris, you should never divide by zero... just because you can't.

This is something one learns as soon as one learns to divide, I'm not sure when that is but I'm pretty sure is before turning 10 years old.

When one turns 20 and decided to study mathematics and has to deal with an analysis class one should be very aware of this fact, however I always say this at the beginning of the term... just to be sure that no one is going to write a division by 0. If such a thing ever happens...


I mention this because I'm currently helping a lecturer to grade his first year Chemical Engineering students and my brain is about to explode when they just casually divide by 0 when faced to a problem of the sort $\lim_{x\to0}\frac{\cos(x)-1}{2x^2}$.

I understand that if one attempts to evaluate directly with $x=0$ one simply can't since the function is not defined at that point and hence we asked only for the limit. My analysis lecturer when I was an undergrad has never been a huge fan of L'Hôpital's rule so I inherited this way of thinking and therefore my first instinct is to multiply the numerator and denominator by $\cos(x)+1$ and find a solution free of L'Hôpital's rule.

Nevertheless, engineers are happy with applying it and that's fine. The problem was that after applying it they now encounter the new problem $\lim_{x\to0}\frac{-\sin(x)}{4x}$ at which point they write again gives 0 over 0... which freaks me out again... and decide that it should be 0, thing that makes me believe they didn't get the idea of L'Hôpital's rule in the first place.

Of course some of the students handed in a decent homework and that is what one is supposed to do. But as one continues to see students writing divisions by 0 something is being done wrong. So here's the summary that encompasses everything one needs to know when found in a situation like this:

NEVER DIVIDE BY ZERO. NEVER!


Monday, 27 October 2014

Technical terms

Recently I took part in a couple of discussions that what no point whatsoever... this defines a pointless discussion, but allow me to elaborate since, paradoxically, I do have a point.

A friend of mine, from the Social Policy Department, was looking for some statistical advice for her research and came to me. She had already a very clear idea of what she wanted to do and her questions were pretty much about whether she was doing the right thing to defend her thesis. I did some research and some review of the concepts and told her she was definitely on the right track, we both were very happy with our productive meeting and went for lunch together...

At lunch we met with our friend, from the Economics Department. I don't have anything in particular against economists, in fact in my first university there were loads of them and I happen to make a lot of good friends there. However, I also learned something: There are economists who suck at maths and there are economists who are good at maths. Now, I am not a economist but as I understand it, Economics is the study of the optimum allocation of finite resources. Economics is then, not a trivial subject, and it can easily be seen how maths may be very useful. So it is natural to assume that all economists have to deal with some advanced stats at some point during their studies. I guess that based on this assumption, my friend decided to explain the economist about her ideas during lunch expecting to find an agreement... big mistake!

What happened was more or less the following. My friend explained she had done a survey and from the information gathered she had extracted some factors that were in line with the theoretical studies. Using these factors she wanted to explain a couple of variables so she was planning to do a regression analysis with the factors as the covariates. The first thing the economist said was that that was not a regression. At that point I asked why not. He said that that was not possible without really giving an argument. I rephrased the problem as the fact that we wanted to know how the factors explain the variables and even make a geometrical description of the problem and explained how a regression analysis was not only relevant but also possible and we had everything we need it to perform it. He stood on his position: That is not possible. He said that should not be called a regression since the variables we were using were factors and what were supposed to do was a "reduced rank regression". I told him I was not familiar with that technique, that maybe he could be right so I asked him to explain what a "reduced rank regression" is. He was not able to explain it, and every step he gave towards trying to get out of his problem he came up with some new technical terms: eigenvalues, time stationarity, etc.

Most of the terms he used I was familiar with, but I felt he was just giving away technical terms with the hope that at some point we would admit defeat in the sense that we didn't have the knowledge to tackle the problem. Nevertheless, I did know the terms and never conceived defeat, I looked up for the reduced rank regression technique and found out that we could have actually been able to implement the method, but it was pretty much the same as we were doing without knowing the terminology. This makes me conclude that the economist was able to identify the technique he needed in order to solve the problem but when I showed him the method he was not able to recognise it. He doesn't really know the method, he just knows when to use it.


The second discussion developed as follows. A friend from the Aerospace Engineering department came to a friend, who does Geometry, and me to try to find a solution to a problem. He wanted to know how we could find an object in space given only the distances to an instrument. We mathematicians agreed on the fact that we can't find the object unless we had more than one instrument, in fact four in space, and know the position of these instruments in space. However, the engineer wanted to know if there was a solution if we didn't know the position of the instruments. During one of our meeting another engineer listened to our conversation and decided that approach to us and told us that we were simply stupid. He argued that that problem had been solved ages ago and there were even algorithms to find the locations. I explained to him that I didn't see how that was possible and that I wanted to understand the maths behind the maths behind the problem. He insisted that our request was a stupid one and the only thing he was able to do during his "explanation" was to draw to circles on a sheet of paper but he was not capable to deduce a single equation. At this point I realised he had no idea of what he was talking about. My engineer friend asked him the algorithm then but he said someone else had it and we should ask that person. He also manage to give away another technical term: "Multilateration".

Neither my mathematician friend nor I were familiar with the term multilateration, but when I looked it up I figured out that it is precisely finding the position a point knowing the distance to four other points. Which was the problem that my mathematician friend and I were able to solve in the first place. So once again the angry engineer had an idea of the method needed to solve the problem but when seeing the maths of the method he was not able to recognise it.



So, what's the point of all this ranting? Well I came up with a bunch of key points:

1. One should not get angry if someone doesn't know something. One can politely say that a problem has been solved and if there's a technical term by which a problem is known by the experts you can introduce it.

2. Do not try finishing an argument by throwing technical terms. Using technical terms is ok as long as everybody in the discussion knows them. If not, one should introduce them.

3. If one can't do the maths of a certain technique do say so. There's nothing wrong in not knowing everything, what is vary wrong is to say people are stupid for not knowing that someone else knows it.

4. In general, obey Wheaton's Law: Don't be a dick.




Tuesday, 21 October 2014

La maestría...

Encontré esta historia que escribí hace mucho tiempo cuando terminé mi maestría. Es un resumen de la historia y aquí está...


Esta parte seguro ya la conoces, pero la aventura realmente comenzó el 7 de septiembre que me fui de vaciones a las Vegas. Apenas lo logré porque me acababan de regresar mi pasaporte con ambas visas, fue una jugada arriesgada, ¡pero salió! En las Vegas, todo estuvo bien y en orden como se esperaba, (salvo que asaltaron al Neto... pero eso es otra historia) regresé el sábado de esa semana casi casi en vivo para la fiesta de despedida que organizó mi mamá.

Al día siguiente me fui a Morelia para pasar el grito pero alcancé a regresar para ir un último día a la oficina el 17 de septiembre de 2010 y no dejé de trabajar sino hasta las 15.00 hrs que me fui a una comida que organizaron en el trabajo... pero mi papá me había invitado a cenar y con la toda la pena del mundo los tuve que dejar ahí en la post comida.

El sábado 18 fue un día normal salvo el hecho de que casi no dormí y el domingo 18 fue el concierto de los 69 Eyes en lunario del auditorio nacional. Saliendo de ahí fui a cenar unos tacos cerca de la Liga Maya... regresé a mi casa a poner mis maletas y el 20 de septiembre en la madrugada tomé el avión rubo a Phoenix... luego Charlotte... y finalmente London el 21 de septiembre a las 7.00 hrs...

Tomé un taxi que por 20 pounds me dejó en casa de mi tía. Yo llevaba prácticamente dos días sin dormir, y esa noche los desquité todos. Me desperté al día siguiente como hasta las 11.00 hrs. Esa semana me estuve paseando por London, caminé por todos lados, y anduve en el metro por todos lados... me perdí, me encontré y le agarré la onda al acento londinense y al cruce de las calles.

El viernes 24 tomé el tren hacia Leamington. Ahí me recogieron Juan y Jorge y me quedé ese fin de semana en casa de Juan. Jorge pagó todo, la cena y la comida del día siguiente, y fui la primera vez que comí comida india, y me volví fan :P

El domingo 26 tomé el tren rumbo a Bath y llegué al lugar de donde te escribo ahora. Mi cuarto en John Wood Ct KA 4.1.4, Avon Street, Bath, England, BA1 1AL es como de 3x5 donde hay una cama, un escritori, un closet y una silla.... y nada más. El piso lo comparto con otros 5 individuos a saber: un chino, uno de malasia, un nigeriano, un indio y un británico. No me caen mal, pero no son nada higiénicos, el baño y la cocina siempre están hecho un asco... pero bueno, la verdad es que casi nunca los veo. Mi costumbre es nunca estar encerrado aquí, mas que en la noche para dormir. Siempre soy el primero en despertar e irme y el último en regresar, salvo los fines de semana, en que a veces el nigeriano llega después que yo porque se fue a una fiesta.

El lunes 27 fue la primera vez que caminé a la universidad. Yo vivo justo en el centro de la ciudad. La escuela está en la cima de un cerro hacia el este de la ciudad. Caminando se hacen aproximadamente 40 minutos. Antes de conocer tenía la intención de conseguir una bicicleta, pero la verdad es que el cerro está muy empinado y decidí que me iba a costar mucho trabajo venir todos los días en bici, así que mejor a pie.

La primer semana fue como un curso de inducción, de cómo usar la biblioteca (que nunca cierra!!... nunca!!), las computadoras, todas las organizaciones, etc. Me dieron también mi paquete introductorio a la maestría, que incluye las instrucciones de cómo debo escoger materias y los temarios, etc. Tuve una entrevista con el director de estudios, que es alemán y se llama Johannes Zimmer, me cayó bien, es un tipo como de 2 metros de alto. Algo que debo mencionar es que en el paquete introductorio venía una circular donde me preguntaban si me gustaría dar algún curso a los undergraduates, obviamente le pregunté a Zimmer qué podría dar yo y me recomendó los cursos de análisis... apliqué y me dieron 2 grupos. Uno de análisis 1 y uno de análisis 2. Me pagaban por eso, y pagan muy bien.

El lunes 4 de octubre empezaron las clases en forma. Yo llevaba 5 materias a saber:

Advanced Mathematical Methods. Esta clase estuvo dividida en 2, la primera parte trató sobre teoría de distribuciones, definió el espacio de Schwartz y toda el álgebra en él. Acabó definiendo las transformadas de Fourier en ese espacio y sus aplicaciones a la solución de ecuaciones diferenciales parciales. Esta parte me gustó mucho!! Pero la segunda parte del curso trató sobre análisis asintótico. Fueron básicamente 4 temas: el método de "matching" de expansiones internas y externas, la verdad no sé cómo se digan todos estos términos en español (que a lo mejor te da lo mismo... pero bueno, yo soy el que está contando la historia :P), integrales oscilatorias, el método de WKB y homogenización. De esas sólo me acuerdo del matching... todo lo demás no lo he vuelto a usar. El profesor era un ruso muy chistoso, y se me hace muy buen profesor. Creo que este fue su último semestre aquí y se va a ir a UCL en London. Aunque esta materia me gustó mucho, estuvo difícil y fue en la que peor salí el primer semestre.... pero pasé :P

Advanced Numerical Methods. Esta clase también la dividieron en dos. La primera mitad estuvo super fácil, el profesor fue Ivan Graham. El empezó desde cero enseñándonos a programar en Matlab, y en 2 meses vimos todo lo que yo vi en el ITAM en 2 semestres... yo digo que estuvo fácil porque para mi fue repaso. Después la mestra fue Melina Freitag, ella nos enseñó métodos numéricos para la solución de ecuaciones diferenciales ordinarias. Esta parte también me gustó mucho. Esta fue la materia en la que mejor me fue el semestre pasado.

Measure Theory and Integration. Esta materia también ya la había llevado en el ITAM... fue la más difícil que llevé allá. Así que me puse a estudiar como bestia salvaje y la dominé. Pensé que esta iba a ser mi mejor materia, pero fue la segunda mejor. El profesor, Nicholas Dirr, también era alemán. Ese semestre fue su último, ahora está en la University of Bristol. Esta ha sido mi materia favorita de toda la maestría :P

Applied Markov Processes and Applications. Esta estuvo padre, el profesor fue Antal Jarai, de Hungría. Vimos precisamente eso, procesos de Markov, y aplicaciones en tiempo discreto y continuo y teoría de colas (queuing theory). Me gustó :P

System Modelling and Simulation. Esta materia no era de matemáticas, era de ingeniería mecánica. Fue la que más trabajo me costó, pensé que iba a ser mi peor materia. Tuve que aprender toda la mecánica que no sabía para ponerte al tanto y poder hacer las tareas que les dejan a los de la maetría de ingeniería... qué horror!! Aprendí un buen de cosas, pero sí me costó mucho trabajo.

La mayor parte del tiempo me la pasaba estudiando y haciendo tareas en la universidad. Cuando no, por ejemplo, los viernes en la noche, me quedaba en la universidad a ver series de animación japonesa hasta tarde con otros chavos. Los martes y jueves también había alguna que otra película interesante que ver. Conocí también a varios hispano parlantes, de México, Colombia, Cuba, Argentina, Perú y España.

En el departamento de Matemáticas somos 3 maestrías: MSc in Modern Applications of Mathematics (que es la mía), MSc in Mathematical Sciences y MSc in Mathematical Biology. Nosotros somos la más grande y somos 15. Entre las otras 2 son como otros 15. Para nosotros 30 hay una oficina en el departamento de Mate en el 4W Building. Pero no todos lo ocupan. Yo sí, prácticamente es como en donde vivo, es lo que acá ocupo como ocupaba la facultad menor en el ITAM... hahaha!!

Mis compañeros (de las 3 maestrías) son mayoritariamente británicos, pero me llevo mejor con los extranjeros, particularmente con Gowri, que es de la India; Ruga, de Japón; Amin, de Algeria; Nikos, de Grecia y Elaine, de Malaysia. hay otros tres con que me llevo bien, Jack, Peter y Charlotte que son ingleses, pero no tanto como con los otros. También hay un chavo del PhD con el que me llevo muy bien, es griego y se llama Vaios.

El primer semestre fue un tanto individualista. Como que cada quien pudo armarlo como pudo. Sin embargo, el segundo semestre fue una locura y rápidamente nos empezamos a formar en equipos. Muy diferente a cómo se trabajaba allá en México, eso sí, nadie se pasa resultados, si acaso nos pasamos un tip que ayude al otro a resolver el problema. Completamente a otro nivel también.

En el segundo semestre mis materias fueron:

Mathematical Modelling and Industrial Mathematics. Imagina que el profesor era Snape de Harry Potter... igualito!! con todo y el acento inglés!! hahaha... El chiste de esta clase era leer algo y escribir una ecuación diferencial parcial sobre el párrafo y luego resolverla... pero era pésimo profesor!!! tuve que leer un buen para hacer las tareas... me hice a migo de la chica que está haciendo el PhD con él y pues ella me ayudaba a veces. Ella es Andrea, de España y me cae muy bien... ahorita se fue a unas conferencias en Amsterdam.

Topic Review of Applied Mathematics. Esta materia es muy rara, nos dieron clase de teoría de redes, problemas inversos y dinámica molecular y después cada quién escogió un tema, escribió un paper y luego hizo una presentación. Yo escogí sobre teoría molecular la teoría de transición de estado... está interesante... y todos opinan que mi presentación fue muy buena... pero eso ya lo veremos.

Scientific Computing. Esta materia se trató de programar en FORTRAN... lo odio!!!! Llegué tarde al examen... por esa razón, no lo pasé... pero me desquité en el trabajo... qu eme fue muy bien... pero es horrible. Aún así, acepto que es interesante, una de las cosas que me parece más interesante es el hecho de programar para que distintas computadoras trabajen sobre un mismo problema, parallel computing. Está muy interesante, pero la verdad el profesor y yo nunca hicimos click en la forma de programar.

Applied Probability and Finance. Se trató más bien de programación dinámica. Está fue la materia más fácil de toda la mestría. Era de esperarse porque la llevé con alumnos de lo que sería sexto semestre en el ITAM... pero no pensé que fuera a estar tan fácil.

Functional Analysis. Originalmente quería llevar Martigale Theory, pero se empalmaba con todo... así que metí esta. Esta materia me gustó. Yo digo que el examen estaba fácil, pero tenías que pensar mucho y pues a nadie le dio tiempo de terminar... a ver como nos va.

Para este semestre de 2 grupos de probabilidad y uno de análisis 1. Me gustó, pero a la fecha no he terminado de calificar todas sus tareas :S Espero acabar mañana.

Acabando las clases, un grupo de amigos y yo nos fuimos de vacaciones a Cambridge y a Oxford... y regresamos a exámenes...

Friday, 26 September 2014

Proportions

So I found this tweet the other day:




I obviously think is a great question... but I got stuck in given a power of ten, say $10^p$, how many numbers are there that are multiples of three and their first digit is three? I believe the answer to this question, and the same but with 7, will give the answer to the problem.

Sunday, 31 August 2014

The Ice Bucket Challenge

The first time I saw a video of someone doing the ice bucket challenge was British Karl's video. I thought it was awesome and I thought was one of those ridiculous things people in England do for charity so very often (like hitch hiking to Paris or eating burritos in all Mission Burritos in England). Well, British Karl happened to challenge Chinese Carl to do it and in turn he challenged me.



I wanted to do it but he challenged me exactly one day before I was going on holidays with my mum and wasn't able to do my video. I went travelling in Europe for two weeks, reason for which I haven't written anything lately, and thought nobody would give a damn about the challenge when I came back. I was so wrong! 2 weeks later the ice bucket challenge was an international sensation! I got another challenge by Katy at the end of the month.



So I decided to take my opportunity and so I did. Here's my video.



As I said at the beginning, I think of it as one of the things people do for charity so very often. In a certain way, people in the maths department kept doing it that way and most of them kept donating for their favourite cause. However, I think in Mexico it seemed like a big deal for many haters. I believe their argument has to do with the shortage of water of certain communities and we were just using it for a stupid challenge... and well, they are not wrong.

Having said that, I consider myself a very "green" person and I consciously try wasting less water, generate less solid wastes, and in general have a lower carbon footprint than the average user in my situation. I can't back up my intentions with actual data, but that's not the point here, what I want to say is that that was something I thought from the beginning and that's why I decided to do the challenge with water that was already there.


It would have been already freezing cold had it been winter, but even during the British summer you may say is not that cold, so I did put some ice on it. 

I don't believe (in the sense of Reservoir Dogs's Mr. Pink) doing stuff for charity... unless it is actually donating or doing the real science. I didn't do the ice bucket challenge because I felt I was raising awareness of the ALS disease, I did it because I thought it was fun.

Tuesday, 29 July 2014

Travelling nearly lightspeed

I'm about to finish reading Why does $E=mc^2$? by Brian Cox and Jeff Forshaw (You may buy it here ). I must say it is not a very good book if you're not already a good mathematician that knows nothing about physics, otherwise I think they just tried too hard in explaining the concepts in a very abstract way without using equations that feels utterly complicated and vague language.


Having said that, I find it a very interesting book. One of the most interesting fact that I got from it is that the $c$ in Einstein's most famous formula is not the speed of light from first principle, that's just a conclusion achieved from experimentation. The $c$ is actually the speed limit at which mass-less particles must travel under the special relativity assumptions, and it must be the same speed regardless of how or who is measuring it. Since apparently photons are mass-less we have to conclude that $c$, the universal speed limit, is the speed of light.


This brings me to my point, which is just a rant about how it feels weird when they break laws of physics in action films. I'm not complaining about they don't respect them in the films, I love action films and I am expecting to see some unreal stuff in there, that's basically what I am paying for. My point is that sometimes it feels weird. I am going to put a couple of examples before getting to my point.



Consider when Steve Rogers in training some boxing in Marvel's Avengers Assemble, while he's punching the bag he recalls his war stories with his team and losing his mind he ends throwing that one punch that sends the bag flying away. The scene is obviously not real, but it still feels ok. I like to thinks that because we know Captain Rogers is capable of doing inhuman feats he has the strength to send the bag flying away and the bag follows the expected intuitive parabolic trajectory. If the trajectory is not parabolic the feel of the scene would not be the same, just as happens with the Crouching Tiger Hidden Dragon film.



Again, this doesn't mean I'm complaining, or that the film is bad, I'm just saying that the changing the laws of physics creates in the audience a weird sensation. But what happens when we're not used to some things happening and still the film decides to fuck physics just because. This happened to me when I saw Star Trek: Into Darkness.



I believe the the Star Trek films are just awesome. However the doubt still haunts me, when the Vengeance fires on the Enterprise it makes a hole on the ship. The next thing that happens is that a lot of stuff escapes from that hole, that's understandable because of the change in pressure but that doesn't mean that jumping from a ship travelling nearly at the speed of light is going to stop you. If one does jump from a ship in space, since friction is basically non existent, then one should have the same speed with respect to the ship. Especially if one's jumping nearly lightspeed because one can't jump faster.

The point is that I felt weird when people flew out and back of the ship, I think they should have flown just out perpendicular to the tangential plane of the ship at the hole. Jumping from a spaceship is essentially different than jumping off a train. At least that's what I feel, however I have never flown at lightspeed or close to that, anyways... I will continue enjoying action films with or without physics misconceptions, and the next one comes this week!

Sunday, 20 July 2014

It's alive!

Today I finally finish proving the result we wanted for my PhD thesis. It has been an epic journey. I wanted to find a rate function for a large deviation principle of the density in the first finite number of sites of a semi infinite totally asymmetric simple exclusion process.

I think that unless one is familiarised with the subject my topic is full of technical vocabulary. So I'll be brief on the explanation of what these all mean.

On one hand there's the large deviation principle. Say you have a sequence of random objects, say tossing coins $X_n$ where they have the value 1 if it's heads and 0 if it's tails, and consider the average of the first $n$ tosses. \[S_n=\frac{1}{n}\sum_{k=1}^nX_k\]

By the law of large numbers we know that this average converges to the actual probability of the toss showing heads, say $p$. Mathematically, for all $\varepsilon>0$ we have that
\[\lim_{n\rightarrow\infty}\mathbb P[|S_n-p|\leq\varepsilon]=1\]

Say we don't want to find the probability of $S_n$ being close to $p$ but any other number $x$, then that limit would be zero:
\[\lim_{n\rightarrow\infty}\mathbb P[|S_n-x|\leq\varepsilon]=0\]

What if we don't take the limit? What if we just take a big natural number $n$? The probability would be close to 0, but positive. Maybe, we can write it like this:
\[\mathbb P[|S_n-x|\leq\varepsilon]\approx\exp\{-nI(x)\}\]

Theory has been developed to explicitly find the rate function. The coin tossing example is the simplest one and can actually be done by hand. However, in general this is not an easy task. The rate function allows you to now the exponential decay rate of the probabilities of rare events, so it's relatively easy to think of applications where this might come in handy.

I have some slides on this here. I think I'll explain what the TASEP is in another post, but the point here is that I proved an LDP for that and I just need to write it down to have a thesis... now I need to finish and get a new job.

Monday, 14 July 2014

Applied maths

Last week I was in Chicago for the annual meeting of the Society for Industrial and Applied Mathematics (or simply SIAM for short). I found very interesting the fact that there are actually mathematicians using real data to work on their projects and not all of them have to do with statistics. In fact, it seems that applied mathematicians have a generalised phobia for stochastic processes and statistics... which is precisely what brings me to write this.

What is applied maths? I have come up with the idea that it depends who you ask. Regardless of the speed at which one travels one always measure the speed of light at the same value... well, applied maths is not a conserved constant in the universe, it pretty much depends on where one studied and what one does for a living.

I have previously said that I studied my undergrad at ITAM and although the website portrays a very broad sense of the subject, in practise it focuses on finance and economics. However the degree is quite flexible and one can certainly focus in computer science or statistics as I did.


I can't say anything bad against ITAM, it is truly a very good university for applied maths. Having said that, I was never prepared for my masters degree at the University of Bath. Contrary to what happens in Mexico where studying maths is a weird thing, studying it in the UK is a more common thing. There aren't many universities in Mexico where one can study applied Maths while in the UK there's a massive market for that. They all agree in one thing: applied maths is solving PDEs, analytically and numerically. In Mexico, the PDE course was only an optional module. In the UK it is the expected thing to know when you're an applied mathematician.

Of course when I mean "knowing to solve PDEs analytically" I mean the easy ones: the heat and wave equations for example. 

The problem arises when somebody outside the maths department asks what applied maths is. Because even if one researches on optimising numerical methods for solving some specific PDEs, to the eyes of the laymen people the solving of the equation is pointless if it doesn't have a higher purpose. What sort of higher purpose? As I like to put it... how does one make money out of that? If one can't answer this question quickly and clearly, whatever one is doing, it is not applied enough.


I like thinking I am an applied mathematician, but being a probabilist doing analysis definitely makes me a weird object within the applied mathematicians at the SIAM meeting. Nevertheless it was quite fun and the research is fascinating... by the way, I had the chance to listen and meet Jorge Nocedal (I didn't see that one coming).



Saturday, 28 June 2014

A Spacetime Odeyssey

I just finished watching the new Neil deGrasse Tyson Cosmos show. It is amazing!

I am not a very emotional person (I just like writing poems because it is hard and challenging), in fact, I remember that the first time my (now ex) girlfriend cried in the cinema and a tear landed on my arm, I thought there was a leak on the theatre. It was until the end of the film that I realised she was the one crying (I believe the film was I am Sam). Anyway, the closes I had been to crying as a response of a media performance was in Final Fantasy VII when... SPOILER ALERT!!!... Sephiroth kills Aeris. Man! That was harsh!



Well, that record has been broken. I didn't, but I felt I was very close to letting a tear leave my eye by watching Cosmos. I really think that the show is touching. He tells the story of how humans have manage to learn what we are, where we are, and basically everything we know. It made me imagine that we know so little about everything and yet is loads more than the knowledge we started with. We humans do are standing on the shoulder of giants, but even up here seeing further is not easy... the Universe is foggy.


I really recommend the show, I particularly like how they tell the story of Faraday and Maxwell, probably because those were the one I didn't know already. But I have nothing bad to say about the show. Seriously, just watch the show!

Finally, I just want to recommend my favourite book ever written by my favourite scientist ever: Surely You're Joking Mr. Feynman. It is simply hilarious! Go to Amazon and buy it now! And talking about deGrasse Tyson, the last Epic Rap Battle of History was awesome. Check it out too!

Tuesday, 17 June 2014

Memo Ochoa

Acabo de llegar a mi casa de ver el partido de México Vs Brasil. Sin duda el partido más cardiaco que he visto en este mundial... y eso que terminó 0-0.

Yo no soy analista deportivo, pero creo que jugaron muy bien ambos equipos, pero lo que sí hay que mencionar es que Memo Ochoa se vistió de héroe. Estuvo donde tenía que estar en los momentos donde tenía que estarlo, hay que recordar que portero sin suerte no es portero.

Acepto que debido a que México llegó al mundial apenitas y de repechaje yo ne le veía muchas posibilidades. Hasta pensaba que perderían sus tres partidos, hoy le empataron a Brasil y creo que hicieron un buen trabajo. Ya puedo decir que sobrepasaron mis expectativas iniciales.

Ahora bien, para ser campeón del mundo hay que ser así consistentemente en cada ronda. No importa quien siga, el chiste es ganar, el empate no sirve.

Esperemos que este partido haya motivado a la selección mexicana y siga creciendo conforme avanza. Pero una vez más lo tengo que decir: señor Guillermo Ochoa, I tip my hat.

Thursday, 12 June 2014

\log11

Aplicaciones de los logaritmos
En áreas ajenas a la ciencia.
Quien pensó en tal incoherencia
Sólo piensa en antilogaritmos.

¿Padecerá de terribles biorritmos?
¡Caso seguro de grave demencia!
Pero saldrá con algo de paciencia,
Si ahora cambia de algoritmos.

Sin importar que tanto las critican.
Sin importar de qué traten los ramos.
Así las matemáticas aplican.

Sus poderes al cosmos intoxican
Por eso hay quienes sí las amamos
Y valoramos lo que nos explican.


Thursday, 29 May 2014

Pizza time!

Yesterday it was my birthday, and apparently it is now customary to write a facebook post saying "happy brthday". I don't usually do that because I know another 500 people are going to do exactly the same thing so I just "like" one of the posts. Doesn't that give the same impression of wishing a happy birthday as the actual post? Anyways... that's not my point here.


The point is, and apparently most of my friends know this, that I was expected to eat a lot of pizza. I guess the regular thing to do is to have some cake, I don't have anything against cake... except chocolate cake. But I can't say no to pizza. My favourite food is pizza and if given a choice pizza always wins. That reminds me that I believe that one doesn't really have a "favourite something" one has a favourite random variable to prefer a favourite something and when asked or forced into selection one generates a sample from that distribution... sort of a quantum preference: at any given time one's preferences are given by a probability distribution and when forced to select, the preference collapses into one single choice, but anyways... that's not my point.


My point is that for me the food preference probability distribution is heavily condensed in pizza. What pizza is a proper statistical question that I won't go into details here but the modes are pepperoni and mushrooms and onion, peppers, olives, and pepperoni. I'm not a nutritionist but I can understand that how if I ate a whole pizza in one night won't be considered a healthy thing. But with the right ingredients, a decent amount, and at a proper time I don't see why it shouldn't be considered healthy. Now I remembered that apparently people are now using interchangeably the terms "vegetarian" with "healthy" which are clearly not necessarily the same thing and even worse the term "organic food" used to refer to food produced with organic pesticides. So now there are tomatoes and organic tomatoes, how ridiculous does that sound? The term organic actually means that is carbon based, but anyways... that's not my point here.


My point is that I believe that pizza once in a while is a healthy thing. Yes, I used to eat pizza every Monday and Tuesday and I did this for a whole year... not healthy at all, but I now have healthier habits. That reminds me that now every time I go back to Mexico it is actually weird to drink still water, and I mean plain still water. Although one of my fattest friends has been doing this for a long time, and there was even a time in which he wasn't fat and went running with us every weekend. I don't know what happened to him... but that's not my point here.


To be honest, I don't think I have a point in all these. So if you want to have a pizza, be my guest. By the way, there are several maths related pizza problems out there. Here's one... I might find some more problems later on...

Tuesday, 20 May 2014

Stats and exams

I haven't written poems in quite a while,
So now that I'm exams invigilating
A task that, trust me, is seriously boring
I'll write a couple of rhymes just to kill time.

Finding the means, variances, covariances,
Probabilities through normal approximations,
And all sorts of weird calculations,
All with symmetric positive matrices.

I now sense one of my student's freaking out
Watched her test, she's not even in problem five!
But right now I can answer her no doubt

Told her to breathe slowly, think, hold on and strive,
And although she's about to cry and shout,
From exams one always walks away alive.

saint_curious_george

Sunday, 18 May 2014

Die Sprache

Die meisten meine Beiträge sind in Englisch weil sie die einfachsten Sprache ist. Die Welt spricht Englisch! Ich finde Englisch eine cool Sprache. Ich mag ihr. Aber ich mag Deutsch mehr und ich brauche mehr praktiziert. Ich soll auf Deutsch mehr schreiben.

我能写一点儿汉字可是我的中文是不好。 我会写在汉字一个post, 可是不今天。



So while I get more confident with my German grammar, I will keep writing in English most of the time. Trust me, I'm working on that, I already have three books in German, two films, and I'm taking my Duolingo exercises seriously... I even listen to the news every morning from Die Tagesschau and I have become a huge fan of theses videos from Kurzgesagt, which are also in English, so give them a try.



Por supuesto que de vez en cuando quiero escribir en español, pero siento que es del que menos práctica necesito. Lo que sí es que siempre me han generado interés los diferentes idiomas. Dejo aquí la versión que más me gusta de la canción de Frozen. ¡Si no han visto la película... no saben nada!

Monday, 12 May 2014

Stolen bikes

There's no clearer proof of the existence of people who suffer a total lack of empathy than those who take the result of others' hard work without remorse.

It is true, life is tough. It has been like that since the very beginning. Being a species on this planet requires one to have a flawless streak of surviving predecessors and the will to do whatever it takes to stay in this world. There was a time when this meant being aware of predators, take the changes of the merciless weather, gather some food, and outlive the competitors. Today it also means surviving the cruel capitalist system and obey man made laws or not get caught by the judicial system.



Any given random bloke is born under certain circumstances under our system, and, yes, climbing up the ladder of the social pyramid is not easy at all especially if one is in the lowest floors. But that doesn't mean that one should be nice to others, does it? 

I've been thinking about this because just recently one of my best friends got mugged and her phone and her just bought new bike was stolen, the very same day she bought it! Her birthday! What a way to celebrate...

Of course I don't know the perpetrator's conditions but I can't but think that that was wrong and low. Fortunately she is doing fine and she wasn't hurt, I can even say that taking the bike and the phone from her is not even a bad thing. But what it is terrible is the fact that one doesn't know when someone is going to be willing to do some harm just to take some material property.


I believe we shouldn't be worried of members of our own society. I'm not a philosopher and I'm certainly not a 100% deontologist but I like Kant's idea on the categorical imperative: always act in such a way that you can also will that the maxim of your action should become a universal law. What I get from this is that one should do as one would like others to do. This exact same statement is even in the Bible! Quoting Matthew 7:12 "So in everything, do to others what you would have them do to you, for this sums up the Law and the Prophets." Agreeing that this is what we would call a good thing, and following Thomas Aquinas's synderesis principle as stated in his Summa Theologica "that good is to be sought and done, evil to be avoided" I think is pretty much clear that stealing bicycles is not the moral thing to do.




Personally the worst part for me is that I feel complete and utterly useless when something happens to my friends that live on the other side of the world because I cannot help them. So yes, do act as Captain Steve Rogers would but remember that not everybody is following the same moral code. Take care.

Sunday, 4 May 2014

Las estampitas del mundial

Cada 4 años el planeta celebra el mundial de football. El mundial. La Copa FIFA. Yo tengo pésima memoria, pero recuerdo claro la primera vez que puse atención a un mundial. Fue en Italia'90 aunuqe el anterior había sido precisamente en México'86, lástima que era demasiado joven en aquel entonces porque no me acuerdo de nada... mucho menos de España'82.


Aunque Italia perdió, me volví fan del football, del idioma italiano, de la comida italiana y con ayuda de las tortugas ninja adolescentes mutantes... de la pizza.


Después de Italia vinieron USA'94, en el que Italia volvió a perder en la final contra Brasil y desde entonces odio que ellos ganen. Luego vino Francia'98, en el que los frances debieron haber perdido contra Paraguay pero un poco de suerte los ayudó. Desde mi perspectiva no jugaron muy bien sino hasta la final precisamente contra Brasil. Si algo me gustaba menos que Brasil ganara en el football en aquel entonces es que ganara Francia. Durante la preparatoria tuve que tomar clases de francés e independientemente de que no me gusta el idioma y no era buen alumno, mi maestra era de esas típicas de "Pongan atención, esta situación es lamentable, por eso el país está como está. Los niños en Francia sí ponen atención en clase." Situación que era bastante molesta. Terminamos entre broma y broma odiando todo lo que tuviera que ver con Francia... asún así Francia ganó el mundial.

En Corea-Japón 2002, ya estaba en la universidad y los partidos eran a los 2 o 3 de la mañana... era algo complicado verlos pero aún así los veíamos. Alemania 2006 fue increíble, por fin Italia ganó además gané la quiniela de la oficina donde trabajaba y básicamente me estuvieron pagando por ver partidos del mundial diario. Literalmente los vi todos, tenían SKY en la oficina. Pensé que en mi evaluación me iban a correr porque no había hecho nada, pero lo sorprendente fue que me fue muy bien... después me di cuenta de que mi jefe era un barco, siempre me fue bien en mis evaluaciones.

Suráfrica 2010 fue el mundial que prácticamente vimos en mi depa. En uno de mis ataques de compras compulsivas compré una pantalla de 50 pulgadas, originalmente para jugar Street Fighter IV, pero sirvió para invitar a la banda a ver los partidos. La final fue Holanda vs España, yo le iba a Holanda porque los españoles le habían ganado a los alemanes que habían jugado muy bien todo el torneo salvo contra el partido contra España. España ganó, pero en un partido lamentable. Si yo hubiese sido el presidente de la FIFA en aquel entonces hubiera declarado que los dos perdían y no hay campeón. Además Holanda aplicó la legendaria "this is Sparta!"... una cosa lamentable, como diría Martinoli.


Ahora el mundial será en Brasil 2014. Personalmente veo al equipo mexicano muy mal, la vez pasada era mucho más fuerte pero una clara decisión técnica contra Argentina los sacó del partido. Hay cosas que nadie entiende, esta es una de esas. Pero la verdad es que ahora no sé que decir de los equipos porque normalmente llenar el album de estampitas de Panini me ayudaba a conocer a los jugadores y estudiar cómo estaba jugando cada país. Este año no lo llené, así que voy a tener que adivinar.


Ya lo he mencionado en posts anteriores, pero este semestre que acaba de terminar di clases de procesos estocásticos, así que me vino a la mente la siguiente pregunta: ¿Cuántos sobrecitos hay que comprar para llenar el album del mundial?

Para contestar esta pregunta se me ocurrió plantearlo de la siguiente manera. Supongamos que para llenar el album se necesitan $N$ estampitas. Un sobrecito tiene consigo $n$ estampitas diferentes de esas N. Si decimos que $X_t$ es el número de estampitas distintas que ya conseguimos en nuestro album después de haber comprado $t$ sobrecitos, entonces la secuencia $\{X_t\}_{t\geq 0}$ es una cadena de Markov con epacio de estados $\{0,1,2,\ldots,N\}$, distribución inicial $\mathbb P[X_0=0]=1$ y matriz de transición $P$ con elementos $p_{k,j}$ definidos como:
\[p_{k,j}=\frac{\binom{N-k}{j}\binom{k}{n-j}}{\binom{N}{n}}\]
siempre que $1\leq n\leq N$, $0\leq k \leq N$ y $0\vee (n-k)\leq j \leq n\wedge (N-k)$ o $0$ en cualquier otro caso. Uno de mis alumnos de hecho reconoció esta fórmula como la distribución hipergeométrica. El porqué esta fórmula es la buena es un problema de conteo y combinatoria que no quiero explicar, pero viendo la fórmula e interpretando cada uno de los factores no es difícil convencerse de que en efecto así es.

Con estas definiciones ahora nos fijamos en la variable que nos interesa: el número de sobrecitos que necesitamos para completar la colección. Pero hay veces que en matemáticas resulta más fácil resolver más problemas en lugar de sólo uno. Esta es una de esas ocasiones, así que consideramos todas las variables que son: si ya tenemos $j$ estampitas, el número de sobrecitos que necesitamos para llenar el album son:
 \[T_j=\inf\{t\geq 0:X_t=j\}\]
El que nos interesa es $T_N$, si no tenemos estampitas y queremos llenarlo. Esto es un n[umero de sobrecitos aleatorio, pero bueno, podemos preguntarnos, ¿cuál es el número de sobrecitos esperado? De otra forma ¿cuál es el número de sobrecitos promedio que los coleccionistas compran para llenar el album? Definamos estos números así: \[y_k=\mathbb E[T_N|X_0=k]\] y no es compicado darse cuenta de que satisfacen estas propiedades:

$y_N=0$ porque si empezamos de un album lleno, no necesitamos más sobrecitos para llenarlo. Pero si no está lleno, entonces necesitamos al menos un sobrecito más y dependiendo de cuántas estampitas nuevas tengamos necesitamos el número esperado de sobrecitos que se necesitan estando en esa nueva posición.

\[y_k=1+\sum_{j=0}^np_{k,j}y_{k+j}\]

Esto da un sistema de ecuaciones:

\[y_k=\frac{1+\sum_{j=1}^np_{k,j}y_{k+j}}{1-p_{k,k}}\]

Mis métodos análiticos dan hasta aquí sin clavarme mucho. Bueno no, en el caso de que $n=1$, es decir, si nada más viniera una estampita por sobre, se puede probar que
\[\lim_{N\rightarrow\infty}\frac{y_0}{N\log N}=1\]
Pero no se me ha ocurrido cómo generalizar este resultado cuando $n\geq 2$. En nuestro caso, $N=410$ porque el album tiene 648 estampitas y $n=5$ porque vienen 5 estampitas por sobre.

Los resultados que se me hicieron interesantes son por supuesto, que el número esperado de sobrecitos es de 911 y si sólo te falta una estampita es de 130. Creo que en México el sobrecito cuesta 6 pesos... esas matemáticas ya las pueden hacer ustedes.


Por cierto, para resolver el sistema, usé unos códigos en R, se los dejo en este link por si tienen mucho tiempo libre.

Tuesday, 29 April 2014

Of comics and films

Let's be honest. Whether you're a big fan or comics or not, the Marvel franchises have been doing great in the film industry. When I say great I don't only mean they've done some serious money with them but also they are very fun to watch.

  
  

Somehow they managed to introduce characters with they own film and then connect all of them in one big awesome combo, which is still fun on its own. Personally, I've always been a huge fan of Spiderman, which is my favourite superhero. I started watching Spiderman cartoons since the 80s, then in the 90s I also watched the X-Men cartoon.



However, what really got me into the X-Men were not the comics nor the cartoons, but the videogames. It all started with the Capcom fighting game X-Men: Children of the Atom, but then came X-Men: Mutant Apocalypse (for SNES in 1994), Marvel Superheroes (1995), Marvel vs Capcom: Clash of Superheroes (1998), and finally Marvel: Ultimate Alliance (2006)



So that's basically all my knowledge on Marvel characters comes from. I became a fan of some particular characters such as Jean Grey, Psylocke, and Gambit besides of course Spiderman during all those years.

But after the Iron Man film in 2008 I became an immediate fan, I think it's a pretty awesome film. I also enjoyed the rest of the films of the Avengers team: The Incredible Hulk (2008), Iron Man 2 (2010), Thor (2011), and Captain America: The First Avenger (2011). I even enjoyed the first Hulk film in 2003 which I still think is good. But Joss Whedon's The Avengers (2012) is just beyond amazing.


I started watching, everything Avengers after that film. My favourite being this TV show called Avengers: Earth Mightiest Heroes which had a pretty cool intro. I guess it was cancelled because Disney preferred to have some consistency among the cartoons and the films rather than the consistency between the cartoons and the comics.


The awesomeness reached by the Marvel Cinematic Universe is way too far over the top for DC comics to try something similar now. They had a pretty cool Batman trilogy where the popular opinion is that was increasingly good, I, in contrast, think the opposite: Batman Begins (2005) was way better than The Dark Knight (2008) which was better than The Dark Knight Rises (2012). Don't get me wrong, I think the three of them are really cool. 

DC then presented Man of Steel (2013) with a fresh start on Superman, but apparently they want to develop this story into a Justice League film. First they announced that the next film will include not only Henry Cavill as Superman but also a Ben Affleck as Batman and, interestingly, Gal Gadot as Wonder Woman.


Clearly, DC is trying to do things differently. I expect them to be able to pull off this really cool too. If their attempt to a Justice League film (which by the way, it totally diminishes the importance of the team when one says Justice League of America) makes it big there's a chance spin offs of solo films will appear and that'd be really awesome. 

What am I expecting from the next "Batman vs Superman" film? Well, firstly, not to be called Batman vs Superman, I expect it to be a story where Superman meets Batman fighting against a common threat, namely: Lex Luthor. I hope it really pays off.
Meanwhile, I'm expecting Days of Future Past and Guardians of the Galaxy to be the big films of this year. One will be released until August but the other one's released by the end of May, so nearly one month now, so I better start watching all existing X-Men films now... you know, just as a reminder of the story so far.

Monday, 21 April 2014

Spoiler free

This is a very serious topic. Decision making would be a trivial problem if there were no uncertainty over the consequences of our choices. Therefore, the knowledge, or lack of, information is vital for the decisions we make, whether they are thoroughly thought or subconscious ones. If one already knew where the goat is in the Monty Hall problem, right?


Well, when one is watching a film or reading a book there are a lot of things going on with one's mind. I'm going to take for example Harry Potter... so this is the spoiler alert, skip this paragraph or keep reading under your own discretion... In the Philosopher's Stone, Rowling keeps developing the idea that Professor Snape is the bad guy of the story but it ends up not being it. During the Chamber of Secrets, the idea still lingers but by The Prisoner of Azkaban we are all quite sure he is a, bad tempered, good guy. Plot twist! In the Half-Blood Prince, Snape kills Dumbledore! Major WTF moment! No one saw that one coming. Would it be cool knowing this from the very beginning? I don't think so.


In recent weeks a couple of very good friends casually posted on facebook a couple of spoilers for Game of Thrones and The Amazing Spiderman 2 respectively, and they're justifying it by saying that the internet is full of spoilers. They do have a point, the internet is full of spoilers. As soon as the plot of anything hits the general public one can find the story on the web. But I believe that one thing is to actively search for that information and another very different is to just find it while reading your facebook.

There's nothing wrong on writing anything, but I think it is quite inconsiderate to post spoilers, or more generally, give spoilers on casual conversations. One should find out if the person one's addressing has already seen the film or if he's intending to see it before giving up a spoiler. Or at least, as I did here, warn your audience with a spoiler alert so that they can decide accordingly.



Another argument I heard is "Dude, read the books!" Well, it so happens that I do read some books, but just as the films I see, I only see the books, films, and shows I like. I read the first LOTR book and I didn't enjoy it on the other hand I really like the films. The other way around, one of my favourite books is Timeline by Michael Crichton, years later they made a film out of that book. I thought it was going to be awesome... and it's one of the worst films ever. But sometimes I enjoy the film and the book too like with Ender's Game.
The point is that the book, the comic, the graphic novel, the videogame, and the film are all different objects even when based on the same story. One should not expect that everybody should know everything. 


So next time you are about to give away some information that was not required by your audience, think about it twice, don't be a dick and don't give away spoilers.