Carrera de caballos aleatorios!!!

Feliz por haber acertado el riddler de la semana pasada, me acerco al hipódromo más cercano y me devano los sesos para resolver el último “acertijo” que nos propone el amigo Oliver y que dice lo siguiente:

The Kentucky Derby is on Saturday, and a field of 20 horses is slated to run “the fastest two minutes in sports” in pursuit of the right to be draped with a blanket of roses. But let’s consider, instead, the Lucky Derby, where things are a little more bizarre:

The bugle sounds, and 20 horses make their way to the starting gate for the first annual Lucky Derby. These horses, all trained at the mysterious Riddler Stables, are special. Each second, every Riddler-trained horse takes one step. Each step is exactly one meter long. But what these horses exhibit in precision, they lack in sense of direction. Most of the time, their steps are forward (toward the finish line) but the rest of the time they are backward (away from the finish line). As an avid fan of the Lucky Derby, you’ve done exhaustive research on these 20 competitors. You know that Horse One goes forward 52 percent of the time, Horse Two 54 percent of the time, Horse Three 56 percent, and so on, up to the favorite filly, Horse Twenty, who steps forward 90 percent of the time. The horses’ steps are taken independently of one another, and the finish line is 200 meters from the starting gate.

Handicap this race and place your bets! In other words, what are the odds (a percentage is fine) that each horse wins?

Primero me planteé la idea de resolverlo con lápiz y papel, pero finalmente, tras haber llegado a la conclusión de que la cosa podía ser bastante ardua, me decidí a utilizar Montecarlo, con Python. Como siempre, os adjunto el enlace para que podáis verlo y modificarlo a placer: https://repl.it/Hjg4/8.

Los resultados vienen dados en la siguiente lista, de la cual he borrado los primeros 13 resultados, ya que son cero. Es el resultado de 100000 simulaciones, así que supongo que el resultado es muy cercano al real. Observad que el caballo 20 tiene una probabilidad de un 71% de ganar la carrera, el 19, apenas un 22% and so on:

0.0009578085340740386, 0.016282745079258656, 0.1264307264977731, 0.893635362291078, 5.2650735118049905, 22.259470331880657, 71.43814951391217

Actualización: Otro acierto en el riddler.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s