Tuesday, April 14, 2015

Cheryl's Birthday

People are talking on the internet about a problem given at a math contest in Singapore, the problem even has a name now, "Cheryl's Birthday". Some were shocked that such a problem was given to 11 years old students (in fact it was given to 15 years old children), but actually there is nothing that would prevent a 4th or 5th grade student to solve it. You need to know only basic logic operations, nothing more, so it is reasonable for an 11 years old child who is good at math to solve such a problem. |Actually when I was in 4th grade I started attending a math circle at  my school and we were doing exactly this kind of problems. I remember even today how happy I was when I solved one of the first of those logic problems and of course I remember that problem too: There was a kingdom having capital punishment. Before execution each convicted person was allowed to appear in front of the king and say a statement. If the statement was false he would be beheaded and if the statement was true he would be hanged. How can a man escape execution in these circumstances?

Many years after I was attending a job interview in Bucharest. It was in those years when people found out that Google and Microsoft gave logic problems at interviews and the fashion spread to other companies. They gave me one problem which I solved and then they gave me a second one which I knew from the math circle. They asked me where do I know it and when I told them that I know it from the 4th grade and I used to solve this kind of problems every week they decided to skip that part of the interview :)

Now don't imagine that I attended some privileged private school. I was raised in Mangalia, a small town in communist Romania, and I went to the nearest school from my house which was still half an hour walk. It was the dedication of some passionate math teachers (Mr. Dinu, Craciunescu and Henny) who were willing to spend their week-ends teaching some extra hours of math for free to some little kids like me and many others. You know, I have to thank them once again here for their effort.

Thursday, April 02, 2015

Libiamo!

De 15 ani de zile Mazare distruge Constanta, orasul in care am crescut: a retrocedat fraudulos o gramada de teren prin toate cotloanele din oras, apoi a dat cele mai aberante autorizatii de constructie. Blocuri noi inghesuite pe peticele de spatiu verde dintre blocurile existente, mall construit in singurul parc adevarat din oras (inca se mai vad cioturile copacilor taiati in parcarea acelui mall) si toate constructiile de pe zona verde dintre lac si sosea din Mamaia. Plus lasarea in ruina a monumentelor istorice din oras, Cazinoul fiind doar cel mai cunoscut dintre ele. Alte cladiri declarate monument au fost lasate pur si simplu sa se prabuseasca pentru ca nu avea dreptul legal sa le demoleze si sa construiasca altceva acolo. Iar mai nou a inceput sa distruga si plajele din oras cu a lui fantasmagorica sosea de coasta. Si in timpul asta omul a furat de a rupt, probabil sute de milioane de euro.

Asa ca dintre toti politicienii anchetati de DNA (are 3 dosare pana acum) el este cel pe care vreau cel mai mult sa il vad in puscarie. Cand a fost retinut acum cateva saptamani am baut un pahar de rom pentru asta si o sa beau inca unul astazi caci a primit mandat de arestare pentru 30 de zile (vezi aici stirea). Si o sa mai beau inca unul cand o sa fie condamnat in prima instanta si inca unul cand va fi condamnat definitiv si tot asa. Si nu beau orice pentru asta, ci un rom din cel mai fin, Takamaka Bay din Seychelles, pentru ca el nu o sa mai mearga prin Madagascar si Brazilia mult timp de acum incolo, iar eu o sa ma plimb pe unde vreau :)


Update: ca sa fie si cu cantec o sa pun si o interpretare a ariei Libiamo din opera Traviata care da titlul acestui post :)



Thursday, March 26, 2015

Despre religie, stiinta si scoala

S-a discutat mult in ultimele saptamani pe tema orelor de religie in scoli. Desi am ajuns tarziu la masa discutiilor, o sa abordez si eu aceasta problema, dar dintr-un unghi putin diferit. In contextul acestei discutii am aflat ca acum cativa ani Ministerul Educatiei a scos teoria evolutiei a lui Darwin din programa scolara la presiunile BOR. Ba mai mult, adeptii bisericii vorbesc de o teorie alternativa, creationismul, si spun ca eventual ar trebui studiate amandoua in paralel, sau lasa optiunea profesorului ce teorie sa prezinte la clasa. Dar nu toate teoriile sunt nascute egale si tocmai despre asta o sa vorbesc mai departe. Epistemologia esta ramura filosofiei care studiaza natura cunoasterii stiintifice, iar una din cele mai mari contributii pe aceasta tema este cartea Objective Knowledge a lui Karl Popper. Ca mai toate cartile de filosofie, e scrisa intr-un limbaj arid, dar ideile principale sunt pana la urma simple si de bun simt (imi amintesc ca discutam acum cativa ani cu cineva despre aceasta carte si am ajuns la concluzia ca ar trebui sa fie lectura obligatorie pentru oricine pretinde ca are de-a face cu stiinta).

Pe scurt Popper sustine urmatoarele:
- cunoasterea umana e formata exclusiv din teorii; de exemplu daca acum e noapte, faptul ca eu ma astept ca in cateva ore sa rasara soarele din nou e o teorie, s-ar putea sa se intample asa sau nu;
- nicio teorie despre lumea din jur nu poate fi demonstrata astfel incat sa fim siguri ca e adevarata. Practic nu putem fi siguri de nimic pe lumea asta, nici macar de moarte si taxe :) 
- o teorie poate fi insa infirmata prin observarea unor fapte care o contrazic; de exemplu, daca teoria mea e ca soarele rasare in fiecare zi la 6 si maine soarele rasare la 7 atunci teoria mea va fi infirmata;
- practic natura cunoasterii umane e negativa, nu pozitiva; fiecare din noi vine cu tot felul de teorii, iar multe dintre ele sunt aruncate la gunoi pe masura ce realitatea le contrazice; sau rafinate, cum este cazul cu teoria lui Einstein despre gravitatie care de fapt o imbunatateste pe cea a lui Newton pe aceeasi tema (care, de exemplu, prezicea gresit orbita planetei Mercur); cred ca chiar acest exemplu cu teoria gravitatiei a fost sursa de inspiratie pentru aceasta carte a lui Popper;
- o teorie stiintifica e o teorie pe baza careia putem face predictii pe care le putem verifica. Aici se despart apele de fapt intre stiinta si religie, magie, filosofie si orice altceva care emite pareri despre lumea asta. Ca sa nu ziceti ca am ceva cu religia, o dau un exemplu din filosofie. Exista un curent filosofic care sustine ca tot ce ni se intampla noua e de fapt un vis. Oamenii astia nu pot fi combatuti cu nimic, daca il ciupesti de mana si il doare el o sa spuna ca de fapt viseaza ca il doare si tot asa. Din moment ce teoria asta nu face nicio predictie care poate fi infirmata despre ce s-ar putea intampla maine ea nu poate fi combatuta.

Asta e de fapt marea problema cu ce se intampla in scoala romaneasca. Acum fiecare e liber sa creada ce vrea si in ce vrea, dar atunci cand vorbim despre materiile care tin de stiinte e aberant sa punem pe picior de egalitate o teorie stiintifica, cum e cea a evolutiei, cu una pe care nu o putem combate in niciun fel, caci sustine ca orice s-ar intampla maine e vointa divinitatii.

Wednesday, March 18, 2015

Interzicerea fumatului in spatiile publice inchise

Astazi Senatul a adoptat un proiect de lege pentru interzicerea totala a fumatului in toate spatiile publice inchise (aici e stirea). Mi se pare o initiativa bine venita, avand in vedere ca actuala lege practic nu functioneaza. Acum e permis fumatul in anumite conditii in baruri si restaurante, precum si amenajarea in alte locuri a unor camere speciale pentru fumat. Barurile si restaurantele cu suprafata sub 100 de metri patrati pot opta sa fie de fumatori sau nefumatori, iar localurile mai mari de aceasta suprafata sunt obligate sa aiba o sectiune de nefumatori care sa fie complet separata de cea de fumatori. In plus sunt stipulate reguli de ventilatie pentru spatiile in care se fumeaza.

In practica se intampla altceva de fapt:
- in mall-uri cafenelele in care se fumeaza comunica direct cu restul coridoarelor si fumul se simte cand treci prin dreptul lor;
- am fost recent pe aeroportul Otopeni si  una din camerele pentru fumat avea usa deschisa; in mod curios chiar langa acea camera era un loc de joaca pentru copii, asa am ajuns noi pe acolo;
- la Hollywood Multiplex din Mall Vitan au o camera pentru fumat care de asemenea era cu usa deschisa cand am fost pe acolo; am inchis usa, dar unul din angajatii cinematografului care fuma inauntru a deschis-o imediat la loc;
- majoritatea restaurantelor in care am fost nu camere separate pentru nefumatori, doar precizeaza ceve de genul: la mesele din partea cutare nu se fumeaza; o exceptie notabila e Trattoria Il Calcio; toate locatiile lor in care am fost chiar au camere separate pentru nefumatori si nu trebuie sa treci prin zona de fumatori ca sa ajungi acolo; sunt singurii pe care ii stiu care respecta legea pe bune;
- in cantina la care mananc la serviciu a inceput sa se fumeze intr-o parte la un moment dat; asa ca am fost nevoiti sa nu mai mancam acolo, ci sa ne luam mancarea la pachet;

In 2009 Comisia Europeana a adoptat o recomandare ca statele membre sa-si protejeze cetatenii complet de la expunerea la fumul de tigara in spatiile publice inchise. Tarile membre trebuiau sa implementeze in cel mult 3 ani aceasta recomandare, deci practic Romania este expusa unor sanctiuni in acest moment pentru neimplementarea acestor recomandari. Un raport publicat in 2013 mentioneaza ca desi toate statele au legi anti-fumat, aplicarea lor lasa de dorit in unele state membre. Exceptiile din legile nationale (cum sunt cele de care am vorbit mai sus) fac legile respective dificil de aplicat. Pentru mai multe detalii consultati aceasta pagina pe tema spatiilor publice fara fum mentinuta de Directoratul pentru Sanatate si Securitate Alimentara.

Din cate am citit in Senat a fost o opozitie destul de vocala la aceasta lege, deci probabil vor urma dezbateri aprinse si in Camera Deputatilor. Asa ca daca iti pasa de aceasta tema ar fi bine sa ii scrii deputatului care te reprezinta pentru a sustine aceasta lege.

Update: din pacate stirea citata mai sus e o pacaleala, legea adoptata interzice complet fumatul doar in scoli, spitale si alte institutii publice, nu si in restaurante si baruri. Eu voi milita in continuare pentru interzicerea completa a fumatului in toate spatiile publice inchise.

Thursday, February 26, 2015

Uber in Bucharest

I saw it all over the news yesterday: Uber launched its service in Bucharest. People are debating now if this is a good choice or not, so here is what information I found so far from a client's perspective.

Good points:
- Uber drivers are required to have a clean judiciary history and clean traffic violations history; cars should be newer than 10 years and insured; 
- from the application you can see the driver's photo, his rating and the registration number of the car;
- once you set your start point and the end point you get an estimated fee for the trip you plan to do;
- the payment is done automatically from your card and you don't ever tip the driver;
- you can rate the drivers, but the driver can rate you too, so behave :)

Questionable points:
- I would have liked Uber to ask also for the maintenance records of the car; you may have a newer car, but if you never check your brakes... This may be an issue in Romania where I still see many cars on the street which do not look well maintained; I think regular taxi drivers are required by law to check their car every 6 months, so even if they skip some tests the basic systems of the car should be in reasonable state;
- you have to put all your card details in the application (including CVV2 code) and they store in their database; this leaves you exposed in case their database is ever hacked; somebody mentioned that card companies say it is forbidden for a trader to store the CVV2 code of your card;
- I'm not sure what happens if you are stuck in traffic, do they have a waiting fee like regular taxis?
- can you change the route from the one computed by the application? for example if you know a less congested one;
- I understand Uber takes a cut from the fee (5%-20%); do they pay taxes in Romania for their profits? do the drivers pay taxes for the money they make? If the drivers have to file by themselves a form to the tax authorities to declare this income I'm sure nobody will ever pay taxes on the money they get;
- the minimum fee is 6 RON and if you cancel an order before getting into the car you will still pay the minimum fee;
 - for now the reported fees are slightly bigger then the ones of regular taxis, but the price may decrease as more drivers join the system; and supposedly you get a better service;

Two more issues you have to pay attention to: if there are big events like soccer games or rock concerts the fees will probably increase because Uber has an algoritm which automatically increases the fee if the demand is high in a particular area like in this case. Make sure you put the correct destination address; if you put another city by mistake you may end up with a $900 bill like in this case.

Overall I think the idea of the Uber service is good, but let's see how the execution looks like. I don't like that the number of taxi licenses are limited by the local authorities, this interferes with the free market for no good reason. But some regulation is needed in this area in order to make people feel safe when they take a ride in the city.

Update: I found out that they also have a waiting fee, similar to the one that taxis have;

Thursday, February 19, 2015

Bring Them Down

"Pune-i la pamant" (Bring Them Down) is a song by La Familia (The Family - a Romanian hip-hop band) which was released in 2005, the same year when the DNA (National Anti-corruption Directorate) was created by Monica Macovei and Daniel Morar was named the chief of this agency. They immediately started investigating important corruption cases (not small fishes like the former anti-corruption agency used to do). I remember listening to this song in my car, together with the news of corruption investigations by DNA. I was wondering at that time if they would manage to finalize those cases and get some big fishes in jail. Ten years after it turns out they just did that big time: 13 former ministers (including one former prime-minister), countless members of the parliament, mayors (from all political parties), judges, prosecutors, police and army officers, university professors, physicians, media moguls, soccer referees and business men that got rich from deals with the government, all of them convicted for corruption and serving time in jail. Probably they didn't totally destroy the "mafia" system that took over Romania after the fall of communism, but DNA (one of the most trusted institutions in Romania today) scared them badly for sure. And they will continue to do so for the next years as they now target also confiscating the wealth that cannot be proven to come from licit activities. So, let's listen this song again, from a new perspective :)


UPDATE: two articles appeared in the international press today covering the activity of National Anti-corruption Directorate (DNA) from Romania. Here is the one on BBC and here the one on The Economist. I'm not sure if they read this post before, I don't see any reference to hip-hop there :)

Tuesday, February 17, 2015

What If Schrödinger's Cat Meows?

While playing with my cat last night it hit me this question: what would happen if the cat in Schrödinger's thought experiment was meowing? You would know if the cat is dead or alive because the meowing would stop. Or maybe you will be in the same superposition with the cat inside the box and you will both hear the meowing and not hear it. Well, technically hearing the meowing is observing that system, so the assumptions of the experiment are not met. But the real question is how well can you isolate such a complex system (you know that cats are complex animals, they can love and hate you :)) from the environment in order to do such an experiment like the one Schrödinger proposed? I googled this and I found a similar question on a physics forum here. It turns out that if a system interacts with its environment (and we are talking not only about meowing, think about gravity influences as the weight of a cat is significant by quantum mechanics standards) then the quantum superposition collapses to only one of the possible options (the term used in physics is quantum decoherence) and you don't have that limbo of a cat that is both dead and alive anymore.
This is the nice part of thought experiments: you don't need to hurt anybody, you just need to think really hard a and you will eventually find your answer :)

P.S. I have to remember to write on how I found out that communism is bullshit via a thought experiment years ago. Remember how many lives were destroyed for this idea, only to learn it the hard way that communism is crap. And some still believe in it...