Wednesday, 20 April 2011

What if Alice used Java?

There was a cool puzzle posted on xkcd blag not so long ago. Well, it was actually more than a year ago... Anyway, the puzzle goes like this:
Alice secretly picks two different real numbers by an unknown process and puts them in two (abstract) envelopes. Bob chooses one of the two envelopes randomly (with a fair coin toss), and shows you the number in that envelope. You must now guess whether the number in the other, closed envelope is larger or smaller than the one you’ve seen.

Is there a strategy which gives you a better than 50% chance of guessing correctly, no matter what procedure Alice used to pick her numbers?
I decided to check what would happen if the unknown and mysterious process of Alice was in fact Java pseudo-random generator.

Monday, 11 April 2011

[PL] Paradoks Monty'ego Halla

W odpowiedzi na dyskusję, która pojawiła się pod pytaniem o wybór bramki w paradoksie Monty'ego Halla, postanowiłem napisać notkę, która dokładniej tłumaczyłaby ideę paradoksu.

Ale najpierw przedstawię oryginalny problem. Sprawa ma się tak:
Zawodnik stoi przed trzema zasłoniętymi bramkami. Za jedną z nich (za którą – wie to tylko prowadzący program) jest nagroda (umieszczana całkowicie losowo). Gracz wybiera jedną z bramek. Prowadzący program odsłania inną bramkę (co istotne – anonsując, że jest to bramka pusta), po czym proponuje graczowi zmianę wyboru. (źródło: Wikipedia) 
Pytanie brzmi: czy zawodnik zyskuje coś przez zmianę bramki?

Tuesday, 22 March 2011

My Daily WTF: [#1] Singleton Field Pattern.

It was yet another sunny and calm day at work for Jerzy K. For the past couple of hours he was doing some updates to the recommendation application and was now ready to submit the code to the shared repository.

Because there was one more guy from another team working on the project, SVN conflicts were nothing uncommon, and so it came as no surprise when one or two of them occured this time as well. Before blindly updating the code to the latest version Jerzy decided to have a quick look. It was the recently committed Product class that was causing the problem. And this is what he saw:

Monday, 21 March 2011

Monday, 7 March 2011

Fail after fail

America will have to wait for me a bit longer as I found out they are not offering me a place on postgraduate study. I guess I am not as awesome as I thought I am. Well, maybe some research projects on the Old Continent will fill the time in between. Or maye not.

I have absolutely no idea at the moment what I will be doing with my life during next academic year...

Secondly, I was asked to write an article about AI

Sunday, 6 March 2011

We are not alone in the universe

There is a small voice in my heart. The voice is small, but it can certainly scream loudly. It is the voice of the explorer and it is absolutely full of joy. It is jumping all around me, banging in the ears, beating back in my skull, rattling in the brain.

It seems there is an evidence of life in the universe. Aliens... but nothing too fancy. There was no Kane with a creature attached to his face, and no Ripley with grappling hook and finally no bloody, penis-like chestburster with incisors!

Something much simpler, more predictable, something... expected maybe?