Monday, 31 March 2014

Exams: Dark of the School (1)...

Esta es la historia de cuando empecé a cobrar por hacer exámenes de matemáticas (2). La escribí a finales de enero, pero aquí va. Así que lo contaré de la manera más heroica posible (3) antes de que me ponga a trabajar (4).

Todo empezó por ahí de septiembre del 2001, me acuerdo de la fecha por la pregunta que me hicieron. Caminaba por la biblioteca de mi escuela cuando vi a una amiga de la prepa estudiando y me acerqué a saludar. Ella no estaba sola (5), estaba acompañada de dos amigas y me dijo “Ya que andas por aquí, tú debes de saber…” y contesté “pues no sé, pero pregúntame y ya te digo si sí sé” y me mostró un sistema de 3 ecuaciones lineales con 3 incógnitas que tenía solución única (6). Evidentemente sí sabía de qué me estaban hablando y les empecé a explicar cómo resolverlo escribiéndolo de manera matricial y mediante eliminación Gaussiana (7).

Cuando terminé de explicar, una de las chicas (8) dijo “No se diga más, ¡Haznos el examen!” y yo así de “¡¿Cómo?! ¿Perdón?”. Ella dijo que era muy fácil, y se dedicó a explicarme la estrategia de cómo le harían ellas dentro del salón para sacar el examen, yo desde afuera lo resolvería y luego era problema de ellas pasarse las respuestas. Claro que también mencionó una cantidad monetaria que me convenció y dije ok (9).

El día del examen fue un éxito, he de haber resuelto su examen de hora y media en veinte minutos y cuando salieron todas eran felices. Quedamos para el siguiente examen… pero ese fue sólo el principio.

Desde que yo tenía como 16 años me di cuenta de que mi vocación era dar clases, a los 17 fue cuando di clases de inglés a unos niños de cuarto de primaria y fue horrible, decidí que lo mejor era dedicarse a las matemáticas y de quinto de prepa para arriba (10). Desde entonces de alguna manera, o mejor dicho mediante el word of mouth, me hice publicidad de que daba clases y terminaban llamándome por teléfono para dar clases de matemáticas. Lo más común es que me llamaran a unos días de su examen final o extraordinario de cálculo o geometría analítica chavos de prepa, pero ocasionalmente también llegué a tener alumnos de primaria (y era horrible) y secundaria (11). Pero el punto es que de la misma manera me empezó a pasar con los exámenes. Me empezaron a buscar para ir a hacer diferentes exámenes de matemáticas y poco a poco fui poniendo más condiciones y precios que dependían de la carrera. Yo era feliz porque básicamente de ahí sacaba dinero para ver todas películas que había en el cine (12). En un símil con Scarface (13) esta fue la etapa en la que todo iba bien, ya me había quedado con la chica y yo dominaba el mercado. Además yo sabía quién daba qué clase y sabía quién iba a estar cuidando los exámenes por lo que tenía información privilegiada. Todo era perfecto.

La primera vez que me remordió la conciencia fue cuando una ingeniera de otra universidad me pidió que hiciera su trabajo final. Pero al final acepté porque escribí un muy bonito artículo sobre cómo calcular recursivamente el “volumen” de las hyper-esferas conforme incrementamos su dimensión (14). Obvio le fue muy bien pero y hace poco descubrí que publicaron mi artículo aquí en la página 14.

La segunda vez y la última fue cuando un ingeniero me pidió que hiciera su examen. Las primeras 2 veces acepté (15) pero obviamente me costaba más trabajo, me tomaba más tiempo resolver sus exámenes y el clímax fue cuando me dijo la fecha de su examen final: se empalmaba con mi examen final de administración de riesgos. Le tuve que decir que no podía estar en su escuela ese día porque yo tenía que estar en la mía. El cuate entró en shock y la historia que sigue creo que nunca estuvo bien planeada.

Me fue a visitar a mi casa a tratar de convencerme de que sí podría hacer su examen. Me dio físicamente el celular de su novia porque por el plan que tenían era más barato hacer llamadas entre esos dos celulares. Me pidió que encontrara una papelería con número de fax cercá de mi escuela y plan era el siguiente: el día del examen se lo entregarían a él una hora antes que a mi el mío. Entonces lo lanzaría por la ventana, la novia lo tomaría y me lo mandaría por fax, yo tenía una hora para resolverlo y hablarle por celular y el contestaría con un aparato bluetooth para que no lo vieran. Yo le dictaba las respuestas y si algo no entendía sólo presionaría números a lo loco para que yo le dictara otra vez.

Eso hice, claro que justo en el momento, se fue la luz en la colonia de mi universidad, la papelería se quedó sin luz… y me tardé como media hora en conseguir el examen. A los quince minutos para mi examen le marqué y le pasé lo que tenía y con 10 minutos tarde para mi examen le tuve que decir que me tenía que ir.


Al día siguiente fue por el celular y a pagarme. No le pregunté cómo le fue y nunca volví a escuchar de él. A la fecha sigo pensando que hay materias que no son necesarias en algunas carreras; sin embargo, creo que son formativas y quizá no debí haber hecho lo que hice sino ayudar de otra forma. No he vuelto a hacer un examen desde entonces, incluso cuando una vez aquí en Bath un chico se me acercó en la biblioteca y le dije que no lo iba a hacer. Pero espero que nunca deje de dar clases (16).


(1) Sí, el título se me ocurrió de la película de Transformers 3… que apestó big time por cierto.
(2) PUM! Sí, acepto que no es algo que haría el Captain America, pero lo interesante es la historia y no el hecho...
(3) Porque la verdad siempre existe una versión de la historia en la que yo hago el ridículo o yo soy el malo de la historia cuando la realidad (subjetiva desde mi perspectiva) es que yo siempre soy el héroe...
(4) Que por cierto la libré heroicamente ayer en mi junta, pero ahora necesito ver si puedo encontrar dos operadores compactos D y E que transformen de un espacio de Banach infinito-dimensional en si mismo con la propiedad de que DE=D+E. La propiedad de que sean compactos es la que todavía me falla… pero tengo un plan, pero eso es otra historia y deberá ser contada en otra ocasión...
(5) Y yo tampoco, iba con mi ex en aquel entonces...
(6) La verdad es que la mayoría de los sistemas que estudia la banda que no se dedica a las matemáticas siempre tienen solución única… en contraste contra los que no tienen solución o tienen una infinidad de soluciones.
(7) Que era lo que tenían que hacer en el ejercicio… nada fancy.
(8) De cuyo nombre no me acuerdo #asusual
(9) Aunque acepto que no puse mucha resistencia. Mi forma de racionalizar la decisión fue que estudiaban merca y RI y nunca iban a necesitar de las matemáticas...
(10) Aunque eventualmente di también clases de Química y otra vez de inglés en la prepa abierta… pero eso es otra historia y deberá ser contada en otra ocasión...
(11) Eventualmente también tuve un par de alumnos que querían hacer una maestría en finanzas y al parecer a los contadores les hacen un examen de estadística para su certificación...
(12) Junto con mi ex… y un bote de palomitas y refresco.
(13) La película de Al Pacino de 1983.
(14) Una esfera en un espacio tridimensional es lo más común. Una “esfera” en un espacio bidimensional es mejor conocida como un círculo. Lo que sigue es generalizar el concepto a una “esfera” en un espacio de dimensión finita arbitraria, por ejemplo de dimensión 42 y cómo calcular la noción de volumen en ese espacio.
(15) En una de esas ocasiones, el presidente Vicente Fox visitaba su universidad y la seguridad estaba a todo y no te dejaban entrar sin credencial. Casualmente me encontré al que después sería mi flatmate (o “roomie” como se dice en el DF…) en el semáforo antes de entrar a la universidad y me metí con él en su coche para lograr entrar.
(16) A partir de la siguiente semana por fin se me va a hacer dar clases de procesos estocásticos… después de esta la única que me falta para estar completo es algún día dar teoría de la medida… pero eso es otra historia y deberá ser contada en otra ocasión.


Sunday, 23 March 2014

Normal tables



Today I'm just going to rant about something that really gets into my nerves, but I think I should put some context into my complaints first.

Statistics deals with the recollection and analysis of data to infer characteristics of a population that will help to take better decisions than alternatives such as random guessing, throwing leaves into the fire and reading the smoke, crystal balls, acid trips, or perhaps the best of the alternatives and Frank Miller's 300 film favourite means of divination: a nearly naked virgin teenage Greek girl serving as an oracle.


Before the age of computers, it must have been really hard to analyse big sets of data so it made sense to welcome all sort of helpful approximations. Without hesitation, the most recurrent theorem in all Statistics is the Central Limit Theorem.

The CLT states, in its simplest version, that if we have a sequence of independent and identically distributed random variables $X_1,X_2,\ldots$ with finite mean $\mu$ and finite variance $\sigma^2$ then the empirical mean converges in distribution to a normally distributed random variable with the same mean and variance $\frac{\sigma^2}{n}$. Mathematically: \[\lim_{n\rightarrow\infty}\mathbb P\left[\frac{\sqrt{n}}{\sigma}\left(\frac{1}{n}\sum_{k=1}^nX_k-\mu\right)\leq x\right]=\int_{-\infty}^x\frac{1}{\sqrt{2\pi}}\exp\left(-\frac{z^2}{2}\right)dz\]

There are two main issues to address in the formula above. First, we should use the formula when $n$ tends to infinity, for practical purposes this means a big $n$, but how big is "big"? While I was an undergrad student and while I was a teacher assistant in high school I recall hearing that students were told that the magic number is 30. Yes, 30 is big enough to think it is close to infinity... read that again! "30 is close enough to infinity", "30 is a close approximation to infinity"... I mean, seriously?!

Let's not make fools of ourselves, or worse, let's not make fools of people working on social studies. 30 is not close to infinity. However, the CLT approximation may be very good with just 30 data points, but that is not because 30 is a spectacularly big number, that must definitely be because of the nature of the random variables we're approximating. If they were originally normal, then the statement is true even for $n=1$ and that sounds quite a long way from infinity.


The other issue I was talking about is the integral on the right: the Gaussian integral. There isn't a simple primitive for it, and hence we just write it like this: \[\Phi(x)=\int_{-\infty}^x\frac{1}{\sqrt{2\pi}}\exp\left(-\frac{z^2}{2}\right)dz\]
We know the median of a standard normal random variable is 0 and hence $\Phi(0)=\frac{1}{2}$. But there's no real way of saying what is the exact value of any given real number other than stating the integral form.

This problem leads to generate the standard normal tables which have numerical approximations to the integral for different values between -3 and 3, where it is significantly not constant (and well, nearly 0 before -3 and nearly 1 after 3)


Arguably, Statistics is the most important branch of maths in social studies and data driven areas of science. Currently, it is easier to gather data than actually making sense out of it and appealing to the closeness to infinity of the sample sizes in some sense, it is clear why the values of the numbers of in the table are important. Having said that, I'm not sure the tables are relevant any more. Furthermore, teaching how to read the tables is not worth the time, especially to social studies students.Why would I say such a thing? Well, nowadays finding those values is as easy as Google them, here's a calculator.

Things are even worse when I was told I should teach my students how to read the table even when at the same time I'm teaching them how to program in R. That's just ridiculous!

One of my officemates argued that you won't be having access to R during the exam, I said that one does have access to it when not in the exam, why should we be preparing students for non realistic situations? Real stats happen with real data, and real data comes in really big, big files! One can't expect students to work by hand and reading values from a table. What should happen is that the approach of the exam should evolve as so has technology.

Just to finish my ranting, if you're teaching stats, I encourage you to push the boundaries into the future! Students can't be preparing themselves for problems from the year 1950. If you're studying stats, I encourage you to push the boundaries into the future! Encourage your teacher to realise that we no longer live in 1950 and there are apps even for hipster fans of Apple to find the values of the standard normal (I'm not kidding! Download it here!). If you're neither teaching nor studying stats, I encourage you to push the boundaries into the future! Someone has to say it to you, but the future is full of data to be analysed and only those with the knowledge to do so will survive.

Sunday, 16 March 2014

Entropic Repulsion

When I finished my masters courses in applied maths I had to write a dissertation to obtain the degree (you may read it here). After talking to several of the probability professors and their different projects I decided to do the research on an application of an entropic repulsion result of Brownian motion (if you want to know about Brownian motion I can recommend Peter Mörters's book which is free here) that translates into one of Galton-Watson trees (to know about these, I recommend this, also free, book here).

I don't want to go through the maths in here, but rather the concepts. So to keep things in perspective think of a snake moving through the desert.


I guess it's not the most reader friendly example, to make it a bit friendlier you may think is one of those elephant eaters from Le Petit Prince (also free here) although I'm not sure how that helps... if it does.

The point is that we would like to imagine it is happily walking through the desert (no, snakes don't walk, they slither, but I'm trying to make a soft transition from reality to the mathematical model, so bear with me) and if we see the path it's taken we'll may find something that looks like this:


Which roughly seems like the snake wants to go to the right although it moves with certain random variations going up and down... but in general to the right.

The question is now, what would the snake do if it encounters a big rock in its way? Entropic repulsion means that in order to preserve the variations (the movements up and down) intrinsic to the system (the path of the snake) the system will force itself to overachieve the obstacle rather than satisfy the minimum condition (that would be stay moving close to the rock). Something like this:


I don't know if I made myself clear enough. Another example of entropic repulsion would be the amount of time studied for the final maths exam by a high school student who usually does very bad and desperately needs a passing mark. It's easier to aim towards a very good mark rather than aiming for the minimum passing grade (he doesn't want to risk the failing mark). Was that clear enough?

Well, here's the punch line of this whole story. A boy in love with a girl can be seen as a system with a clear path (he wants to see and be with her) with some random variations (some times he'll try reaching her on the phone, go for dinner, to the cinema... who knows... many dimensions in here rather than just movements up and down). Now, what if there's a big obstacle in he's way? Well, in light of the entropic repulsion phenomenon we should expect he tries to overachieve his goal (make her be in love with him too). So maybe instead of writing her one casual text he writes her poems, who knows... what sort of obstacles could we give as an example? Well, say he suddenly finds himself on the other side of the world without the budget to make the trip back... who knows.

The bad news is that in contrast with the snake or the the student, the love system has a goal that's also moving in the other side and has it's own variations so it's not necessarily a direct analogy.

Anyway, I'm just writing this because I'm sort of proud I found a mathematical way of analyse an otherwise psychological case. Although I'm not sure real applications can actually be done, I think it is a nice thought that some boys are willing to climb really big rocks.

By the way, last Friday was Pi Day... and although Vihart is a pro-Tau person, I still love her videos. Enjoy!