22 June 2014

Between Today and Yesterday


Between today and yesterday we experienced the Summer Solstice. It was at 7:51 am Central Daylight Saving Time on Saturday, June 21st. I say it was "between today and yesterday" because the daylight hours for both days are the same length. The thing that I never really realized, however, is that here in Irapuato, Guanajuato we only experienced fourteen hours and thirteen minutes of total daylight while the lucky gee whiz folks in Chicago, Illinois received a whopping sixteen hours and twenty-two minutes. Hey guys...that ain't fair!

Wait a minute...this just in! At Christmas time we get eleven hours and 41 minutes of total daylight and you only get ten hours and eleven minutes but that is only if your sun is shining and not frowning. In Chicago during the Winter Solstice just before Christmas it will probably be cloudy or snowing and only ten degrees above zero while I will still be picking tomatoes in my shorts and flip-flops...so there!


15 June 2014

Three Little Pigs

The other day I read a blog post on "Ripples, Very Small Waves in R"
http://aschinchon.wordpress.com/2014/06/08/the-three-little-pigs/
It is about a game of dice called "The Three Little Pigs" where only
one die is used. The rules are:

"Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player decides to hold. If the player rolls a 1, they score nothing and it becomes the next player’s turn. If the player rolls any other number, it is added to their turn total and the player’s turn continues. If a player chooses to hold, their turn total is added to their score, and it becomes the next player’s turn. The first player who reach at least 100 points is the winner."

I showed this game to my eight year old grandson and he was delighted. He calls the game "Cochinito" (little piggy) because in this game you are penalized by chance if you get too greedy. He is playing it with anyone and everyone he can talk into it. He kept talking about good luck and bad luck so much that I decided to teach him a little bit about probability. I showed him that with one die each number has an equal chance to land face up and since there are six numbers on the die the probability of throwing any particular number is 1/6 or in other words about 16.7 percent. I made some simulations and graphs in "R" programming with the help of "R Workshop for Beginners" (Barry Rowlingson,Lancaster University, UK http://www.maths.lancs.ac.uk/~rowlings/Teaching/Stafford2013-Sept/dice.html

The simulations let you make multiple rolls of the dice and let you see the distrbution of the multiple roll results. Here are the results for four sets of 100 roll trials with a single die:

 1  2  3  4  5  6
18 18 15 15 22 12

 1  2  3  4  5  6
15 17 15 19 13 21

 1  2  3  4  5  6
19 18 14 18 20 11

 1  2  3  4  5  6
19 16 19 18 14 14

Here is the result of a 10,000 roll trial:
   1    2    3    4    5    6
1664 1639 1695 1651 1680 1671

You can see that as the number of multiple rolls increases the average gets closer to 16.7.

Here is the result order for the roll of one set of 100 rolls with a single die:
6 5 4 5 6 3 5 5 4 4 1 1 3 4 5 6 4 4 4 4 6 5 1 4 1 3 1 3 3 2 6 4 3 2 1 5 3 3 1 3 2 5 1 2 6 6 6 3 2 3 1 3 2 6 5 1 2 5 6 4 1 6 2 5 4 4 4 4 2 1 5 4 5 6 6 5 5 6 5 1 4 3 1 6 1 5 3 6 1 3 5 6 2 6 4 2 2 1 2 3

Each 100 rolls of a single die will result in a new random number. You can see that you never know when the number "1" will jump up and grab you or leave you alone for awhile.

This is the R code that I used:

table(as.integer(runif(10000, 1, 7)))  # method with one die

table(sample(1:6, 10000, replace = TRUE))  # Alternate  with one die

# Wrapped in a function and plotted - one die
die = function(n) {
  return(sample(1:6, n, replace = TRUE))
}
table(die(10000))
plot(table(die(10000)))

# Wrapped in a function and plotted - two dice
die = function(n) {
  return(sample(1:6, n, replace = TRUE))
}
table(die(10000))
plot(table(die(10000) + die(10000)))

# A dice function to throw one die 100 times and return the result.
die = function(n) {
  return(sample(1:6, n, replace = TRUE))
}
dice = function(T = 100, N = 1) {
  m = matrix(die(N * T), N, T)
  return(colSums(m))
}
dice()

# A function to throw two dice 100 times and return the sum.
die = function(n) {
  return(sample(1:6, n, replace = TRUE))
}
dice = function(T = 100, N = 2) {
  m = matrix(die(N * T), N, T)
  return(colSums(m))
}
dice()

This video by Eric Cai is very helpful in explaining the probability of rolling dice:
https://www.youtube.com/watch?feature=player_detailpage&v=VZl7gkMbipk

05 June 2014

I can see clearly now...

I can see clearly now the rain is gone.
I can see all obstacles in my way.
Gone are the dark clouds that had me blind.
It's gonna be a bright (bright) bright (bright) sunshinin' day.
(Jimmy Cliff - I Can See Clearly Now)

A couple of years ago I felt like I needed my vision checked because things were getting a little fuzzy. The doctor changed my prescription and warned me that I had the onset of cataracts and that I should return in about six months to see if the situation was deteriorating. Well, one thing lead to the other like they always seem to do and I procrastinated until finally I knew that I had to do something. My vision, which was never very good anyway, had deteriorated to the point where I couldn't even drive at night because of the blurriness caused by the headlights of the oncoming cars and the street lights.

I returned to the eye doctor, an ophthalmologist named Dr. Alejandro Aldana Fariñas, who has been my eye doctor for quite a few years. After admonishing me for my foolhardy tardiness he announced that I could put it off a little longer if I so chose but that he recommended that I have the cataracts removed from both eyes...and so I did. It turned out to be a good choice.

Once again I am pleased to report that the medical care that I received from Dr. Aldana is better than I had ever experienced in the United States. We are very fortunate here in Irapuato to have the large, state-of-the-art eye care clinic that he runs which I think is at least the best in the whole State of Guanajuato if not the whole of the Central Mexico Region outside of perhaps Mexico City.

I had the left eye done first on Saturday, May 17th and the right eye done on Saturday, May 31st. On both occasions I arrived a little before the appointed time of 8:am and was ushered to a room to change into surgical clothing. Then I was taken to a place adjacent to the operating theater where my eye was prepped with various medications and procedures. From there I was moved to a reclining operating chair where the operation was performed quickly and professionally. It only took about fifteen minutes. After a short time recuperating afterwards I was allowed to return home with a plastic eye shield over the eye. It took about four or five hours for the effects of the anesthetic to wear off. Until then I had some double vision but that gradually faded away.

Right after the first eye was done I knew that I had done the right thing. For one thing I could see out of my left eye much better than I ever could before. The replacement lens that was inserted in place of the cataract had corrected much of my vision problem. I also noticed that everything that I saw with my left eye was very bright and colorful and my right eye which hadn't been done yet made things appear dingy and with a yellowish cast that I had never noticed before.

There was one other aspect of the cataract surgery that I had never even considered. With my new vision it gave me a new vista on life itself. Absolutely everything seems brighter and my spirits have risen to a new level. It is a really blessing from God and I have asked God to bless the doctor and all of his fine assistants and nurses. The service was great, the equipment very modern, the people were all nice, and on top of everything else, the cost was reasonable. That's about as good as it gets.


Blog Archive

About Me

My photo
I was born and raised in Chicago, Illinois, U.S.A. I have been living in Mexico since January 6th, 1999. I am continually studying to improve my knowledge of the Spanish language and Mexican history and culture. I am also a student of Mandarin Chinese.