| brain activity log
12.03.2007 - Monday - 03:57 - Star Wars
| |
|
Anakin Skywalker, now Darth Vader:
| |
 |
| |
Where is Padmé ?
Is she safe ?
Is she all right ?
|
| |
|
Lord Darth Sidious:
| |
 |
| |
It seems.. in your anger... you killed her
|
| |
05.03.2007 - Monday - 13:08 - Rhinovirus
I got cold ://// Damn rhinovirus.
Well..it's the most common illness in the world and I haven't got it for a year now so
nothing special: I'll be outta home in a couple of days. I'll take it constructively
and try to study & work anyway.
I've just discovered that I've been using the terms
influenza
and cold interchangeably.
In fact these are two distinct ilnesses with common symptoms, both caused by viral infection.
Influenza is caused
by the very specific family of
Orthomyxoviridae
RNA viruses while the common cold
is caused by several families of other viruses affecting the respiratory system
(mainly rhinoviruses, coronaviruses, and also certain echoviruses, paramyxoviruses, and coxsackieviruses).
In humans, influenza's effects are much more severe than those of the common cold, and last longer.
Common cold is deadly in one case over 50.000 while influenza has been a pandemic killer in the past
and can be still deadly for the weak, old or chronically ill. Mine
is almost surely common cold
because I have no fever.
I had to void the appointment at Sistemi ITC. Shifted to friday.
Romina obviously thought that the illness was an excuse :D It couldn't be: I wouldn't miss
a meeting with such a nice girl unless there was a real reason :P ... especially in such a sunny day.
Back to work (sugar reef).
25.02.2007 - Sunday - 22:21 - Diary
There are ongoing massive changes in the
continuum :)
TVS service is moving offices from the peaceful EBS establishment
to the primary Bassilichi dept.
People aren't happy about it. Well, the bright side is that innovation might bring positive results.
We'll see.
Upgraded gentoo on
etherea. It took me several days and caused
some headcaches. I had to fight with random
segfaults
caused by a faulty DRAM
bank and completly messed dependancies.
At a certain point something something got totally
b0rken and
I've ended up with a system unable to compile and run 32 bit apps.
Bleah :D Well... I've fixed it and I'll be probably switching
to gcc 4.1.1 too,
in the next days.
Linux etherea 2.6.19-gentoo-r5 #3 Sat Feb 24 17:02:52 CET 2007
x86_64 AMD Athlon(tm) 64 Processor 3500+ AuthenticAMD GNU/Linux
Almost finished porting kvirc to
Qt 4: only few modules are missing now.
Got it to a point where others can take care of separate modules: Noldor is
taking care of the objects.
Bought a new shiny Sapphire Radeon X1950 Pro. Too bad it doesn't boot with my Abit MoBo :(
In fact it gets through BIOS,
it does POST but it
locks up nearly in the end, probably when attempting real boot by invoking INT 19h.
It *might* be a problem related to the power supply not being able to source enough current.
Tomorrow I'll buy a 500W or greater unit and will try. If it doesn't
work then I'll try to upgrade the BIOS.
Studied a massive number of metal songs recently. It's very fun to play them.
The most recent entries are "Tornado Of Souls"
by Megadeth and
"Antisocial" by Anthrax.
Actually I'm taking on "Anna Molly" by Incubus
and "Can I Play With Madness" by Iron Maiden.
Spam is reaching absurd levels.
Spamassassin behaves quite well but
since once in a while it blows out a false positive I'm substantially forced
to dig in the trashcan looking for reasonable subjects or known senders. Hate it.
This blog gets spammed too: it looks like I can't filter them out all.
I need to add some anti-spam measure like the "type the digits you see" image...
Released GEOS 2.0.0. It works like a charm :)
Started the fourth eTraveler milestone: will mainly take care of path updates and implement a new XML data format.
Will also try to doom some of the remaining TomTom Navigator problems...
Eva is moving to London...
or somewhere nearby. She will be working for RedHat:
a great chance! Good Luck Eve!!! :*
There are rumours about CNR.
14.02.2007 - Wendesday - 23:30 - PragMathic Valentines
This 3d surface is supposed to be a Valentines heart.
In fact it's a 30400 polygon phong shaded
RGB=255,0,0 numeric approximation of
illuminated by a spot light placed at (-1.0,-1.0,0.8).
I had a couple of hard hours while trying to plot (and later render)
the implicit equation with matlab but in the end it looks rather nice, eh ?
02.01.2007 - Tuesday - 02:55 - Primality Tests
Happy New Year to everyone :)
At a certain point, in the middle of the New Year party we ended up
talking about prime numbers. The simple question was if 2007 was prime or not.
A guy immediately comed out with the answer: no, it's divisible by 3.
He used a simple "rule of thumb": if the digits of a number sum up
to something that is divisible by 3 then the original number is also divisible by 3.
And in fact 2+0+0+7 yelds 9 that is obviously 3*3.
So 2007 is not a prime year. But how is it that the rule of thumb works ?
We were quite convinced that the rule is correct by carrying out
a ton of working examples but (probably because of alcohol :D) were unable
to prove it.
In fact a pedantic proof is not as trivial as one might expect for such a simple rule.
Anyway, a bit of thinking (with a sane mind) pulled it out. Here it is.
Theorem
Given an integer x let y be the sum of its decimal digits. If y is divisible
by 3 then x is also divisible by 3 and vice-versa.
Since for x=0 the theorem is trivially true, let x be a non-zero integer and consider
it's positional rappresentation:
The digits di in the sum are obviously the positional digits of x
ordered by magnitude (power of ten). Let y be the sum of the digits of x.
Asserting that "if y is divisible by 3 then x is also divisible by 3 and vice-versa"
is equivalent to asserting that "if there exists an integer w that yelds x=3w then
there must exist an integer v that yelds y=3v and vice-versa".
A yet more convenient way to formally state the theorem thesis is: given
prove that "if w lies in Z then also v lies in Z and vice-versa".
To prove this let's concentrate on the positional rappresentation of our number.
We can trivially rewrite it as
which can be decomposed in
which clearly shows that the second component is the sum of the digits defined above
and allows us to write
and then rewrite it further as
Now if we assume that w is an integer then v is an integer (lies in Z)
if and only if
The same condition remains if we first assume v to be an integer
and ask for w being an integer: it still
leads us to prove that
Now if you're cool, you should have already be "seeing" the end of this
proof since the formula above can be "trusted" to be true if you realize
that 10^i - 1 leads always to a number with digits formed by a sequence
of all 9.... but let's be pedantic and prove this formally.
To do this we need to take a quick look at a nice property of the foolowing
geometric serie:
We can multiply both sides by (a-1) to obtain
Expliciting the multiplication
and removing the cancelling terms we get
which is quite interesting since by plugging in a=10 it allows us to write that
and for i=k+1 -> k=i-1 it allows to rewrite our clue formula as
and then by trivial algebric manipulation
Remember that in the formulas above we have assumed x != 0 (since, as stated at the beginning,
for x=0 the theorem is trivially true). This in turn requires i > 0 and
thus i-1 is at least 0.
Finally since , since 10^j is
an integer and a sum of integers is still an integer it's obvious that
which proves our theorem.
Cool eh? What a strange world... :)
It is interesting to state that this thingie can be applied recursively.
If y is too big to be trivially known to be divisible by 3 then
the sum of its digits can be taken and the theorem can be applied again.
Another note is that the theorem will work for bases B that can be written
in the form B=3N+1 where N is an integer. It will work for base 4, 7, 10,
13, 16... but not for base 2 (for example). This can be proven by substituting
(3N+1) in the whole theorem in place of 10 and noticing that it will lead
us to prove that
The geometric serie property is still valid and yelds
which is rewritten as
This allows us to rewrite our question as
which, since di and N are integers, yelds the obvious conclusion that
Marvellous...
One can push this thingie even further and assert that to verify
the divisibility by a number D one has to write the number x in a base B
that can be written as B=(DN+1), where N is an integer greater than zero,
sum up the digits of B and verify if the obtained number is divisible by D.
This can be proven by reusing the
last version of the theorem and plugging D instead of 3. The question
will now be
And it will lead us to state that
Which is indeed true since D, N and di are integers.
Interesting. So if you want to know if 3147975 is divisible
by 255 all you could write 3147975 in a base of the form 255N+1,
for example 256 (huh.. we're talking of BYTES!), sum up the digits
and check if it's divisible by 255, recursively.
3147975 is (48)(8)(199) in base 256 which magically sums up to 255.... doh!
I could have written this thingie in base 255*2+1=511, which would yeld
a rappresentation of (12)(28)(215) which again sums up to 255.
Unbelieveable...
The bad news, eventually, is that this theorem can't be easily used
as a general primality test since it involves base changes. A generic change
from base A to base B requires consecutive divisions of the original
number... so one can actually directly divide the number by the divisor
and check if there is a remainder...
This can be used as primality test for some divisors,
in particular the ones that lead to the bases B to which switching
is easy. Switching from base 10 to base 100 is straightfoward and
does not require any division to be performed. Same goes for base 2 and base 16,
for example.
Now I have to work. Further investigations later.
Have a nice day!
want more ?
... really ? :D
Browse around then.
You're viewing 5 posts per page: you can view more or less, if you want.
The entries marked in red are the ones you're viewing now.
|