New math problem of the month series
A new math problem of the month series has started up over at problemas | teoremas – a dual language English, Portuguese blog written by Walking Randomly reader, Américo Tavares. Américo successfully solved some of the problems I set here in the past and now he has started his own series.
Check out the first problem here but try not to look at the comments section if you don’t want any clues.
Hi Mike
Many thanks for your post.
Only a few of my posts are in English.
Now I have greater responsabilities towards you and your readers.
Best wishes,
Américo
Hi Américo
perhaps it would be more appropriate for us to learn Portuguese :)
Best Wishes,
Mike
Hi Mike
You can try this site
http://www.linguasnet.com/Index_pt.php :)
Best Wishes
Américo
Just to say I’ve posted Problem of the month #2, an easier one, I think.
I’ve just posted Pierre’s Bernard solution here
http://problemasteoremas.wordpress.com/2009/07/20/problema-do-mes-problem-of-the-month-resolucao-do-problema-1-solution-of-problem-1/
My Problem of the month #2 was posted today here
http://problemasteoremas.wordpress.com/2010/01/06/problema-do-mes-problem-of-the-month-3/
I invite you and your readers to submit a solution.
All my Problems of the Month have been collected in this page
http://problemasteoremas.wordpress.com/problema-do-mes-problem-of-the-month/
Hi Américo
Thanks for that – they look great all collected together like that. A nice resource :)
Best Wishes,
Mike
Thanks, Mike!
This is my first Python script to calculate and type the Easter Sunday date of a given year:
http://problemasteoremas.wordpress.com/2010/02/17/script-em-python-do-algoritmo-de-o%e2%80%99beirne-para-calcular-o-dia-e-o-mes-do-domingo-de-pascoa/
I’ve defined the easter(x) function.
Here is a copy (without identions, although important as they are! I am going to try some )
Exemples of easter():
>>> easter(2010)
In 2010 the Easter Sunday is on April 4
>>> easter(2011)
In 2011 the Easter Sunday is on April 24
def easter(x): # Python script that defines the easter(x)
# function, where x is the year.
#
# Based on the 10 step O’Beirne’s algorithm to
# compute the date of Easter Sunday of a given
# year.(Computes and writes the day and the month)
#
#
b = x / 100
c = x – 100 * b
quotient = (5 * b + c) / 19
a = 5 * b + c – 19 * quotient
d = (3 * (b + 25)) / 4
e = 3 * (b + 25) – 4 * d
g = (8 * (b + 11)) / 25
quotient = (19 * a + d – g) / 30
h = 19 * a + d – g – 30 * quotient
m = (a + 11 * h) / 319
j = (60 * (5 – e) + c) / 4
k = 60 * (5 – e) + c – 4 * j
quotient = (2 * j – k – h + m) / 7
l = 2 * j – k – h + m – 7 * quotient
n = (h – m + l + 110) / 30 # n is the month(numerical value)
q = h – m + l + 110 – 30 * n
quotient = (q + 5 – n) / 32
p = q + 5 – n # p is the day
if n == 3:
N = ‘March’ # N is the month name
else:
N = ‘April’
if quotient != 0:
print ‘error’
else:
print ‘In’, x, ‘the Easter Sunday is on’, N,
Question: how can one plot a function in Python? Is it possible to print it on the computer monitor? or does one need to have a plotter?
I have a second script to compute all the primes up to a given N. It generates two lists and outputs the primes. I a modified a script that evaluates and plots an extremely rapid oscillating function, written by a computer scientist who is attacking the Erdős Discrepancy Problem (EDP) together with other mathematicians, computation scientists and theoretics. The algorithm itself was a Gowers’ idea. All this is taking place on the Professor Gowers’s Weblog (http://gowers.wordpress.com/), since mid January.
I downloaded Python to my desk computer a few weeks ago and edited the scripts I mentioned in the IDLE environmental that came together.
Best Wishes too,
Américo
Hi Américo
There are various plotting modules in Python but I tend to use matplotlib
http://matplotlib.sourceforge.net/
Let me know how you get on.
Best wishes,
Mike
Hi Mike!
Thanks for your information, since you are a Python expert.
Best wishes,
Américo