
Prime Minister of Singapore Coded Sudoku Solver in C++ - doppp
http://www.pmo.gov.sg/mediacentre/transcript-speech-prime-minister-lee-hsien-loong-founders-forum-smart-nation-singapore
======
devnonymous
The relevant excerpt from the speech:

    
    
        40 years ago, after doing a math degree, I went on to study computer
        science, on my father’s advice.  He said there is a future in that, and he
        was right.  So for the Smart Nation Programme Office, I have put Minister
        Vivian Balakrishnan in charge, reporting to me.  Vivian is both a hacker
        and a dabbler – He used to be an eye surgeon but since he does not get to
        operate on eyes nowadays, he dabbles in building simple robots, assembling
        watches, wireless devices and programming apps.  His day job is to be the
        Minister for the Environment and Water Resources, and so when he builds
        apps, he uses the real time APIs generated by the Ministry.  That’s called
        user-testing.  I used to enjoy this; it is a long time since I’ve done
        anything.  The last programme I wrote was a Sudoku solver in C++ several
        years ago, so I’m out of date.  My children are in IT, two of them – both
        graduated from MIT.  One of them browsed a book and said, “Here, read
        this”.  It said “Haskell – learn you a Haskell for great good”, and one day
        that will be my retirement reading. 
    

What's amazing is not just the bit about having written C++ code but the fact
that he used the term hacker propely and knows what Haskell is. Interesting.

~~~
creamyhorror
As a Singaporean, I'm pretty proud of the direction of my government, and I'm
pretty surprised by the Haskell/LYAHFGG & C++ namedrops. How did Minister
Balakrishnan even find the time to dabble with hardware and programming? These
top civil servants are very, very busy!

Great quote about Singapore citizens trusting the government to do their
taxes:

 _"...we introduced electronic tax-filing back in 1998, since ages ago, before
anyone else did it, and today, 97% of tax payers file their taxes online.
Because we have kept our tax code simple, you do not need to buy Quicken,
Intuit or any of such things. Also, because we have automate the collection of
information and populate the table for you, you do not need to work quite so
hard – it is a little harder to cheat and so 3 in 5 taxpayers do not even
bother about filing taxes. They just take in on trust that our Inland Revenue
Authority of Singapore has done their sums right. So e-Government works in
Singapore."_

That said, the 3 verticals of the whole Smart Nation programme (the elderly,
transport & data) seem somewhat orthogonal to much of the SV-style explosive-
growth consumer apps. Yet those consumer-app areas are where many SV-style
fortunes are made and where young tech entrepreneurs want to go - so there's a
disconnect between the two directions.

For example, I don't see massive adoption of a new app/device by the elderly
happening very easily - they largely (1) don't know English, (2) aren't used
to relying on tech so heavily, and (3) won't be able or willing to pay much
for it. It tends to be younger people who try new things - and in fact
Singaporeans are relatively less adventurous than Americans or other Asian
cultures in adopting new apps/services. Things might be different if Singapore
were as big as the US, but it isn't. So I wonder how the Smart Nation thing
will play out - maybe the biggest customer will be the Singapore government
instead of end-users.

(Tangentially, it's personally been a bit frustrating that the VCs that draw
on government money seem to prefer e-commerce/B2C apps instead of industry-
specific B2B software. The government puts its money where its mouth is, but
still relies on VCs to make the picks...and those guys go for hot, mainline
trends. So fundraising has been difficult.)

~~~
jwiley
Wonder if you have FoxNews or a similar variant in Singapore? Do they
characterize the Prime Minister as a professorial egg-head elitist out of
touch with the common man?

If not you have something to look forward to, in the early days of our
republic, we generally appreciated educated statesmen. Now we prefer our
elected officials to be fun-loving guys next door who see the internet as a
system of tubes.

~~~
l10nf15h
Singapore is a one party state with a terrible human rights record. If anyone
criticized the government, they would be thrown in prison and/or fined.

~~~
visakanv
Singaporean here, have criticized the govt multiple times, protested govt
policy, am doing perfectly fine, thanks!

------
kszx
Cambridge professor about Lee Hsien Loong:

"No, he was truly outstanding: he was head and shoulders above the rest of the
students. He was not only the first, but the gap. I think that he did computer
science (after mathematics) mostly because his father didn’t want him to stay
in pure mathematics. Loong was not only hardworking, conscientious and
professional, but he was also very inventive. All the signs indicated that he
would have been a world-class research mathematician."

"I’m sure his father never realized how exceptional Loong was. He thought
Loong was very good. No, Loong was much better than that. When I tried to tell
Lee Kuan Yew, “Look, your son is phenomenally good: you should encourage him
to do mathematics,” then he implied that that was impossible, since as a top-
flight professional mathematician Loong would leave Singapore for Princeton,
Harvard or Cambridge, and that would send the wrong signal to the people in
Singapore. And I have to agree that this was a very good point indeed."

[http://therealsingapore.com/content/cambridge-professor-
lee-...](http://therealsingapore.com/content/cambridge-professor-lee-hsien-
loong-could-have-been-outstanding-mathematician)

~~~
dengnan
Just one nitpick: his family name is Lee. Loong is just a half of his given
name. So calling him Loong is a bit weird.

~~~
kszx
His father also called him Loong (not Hsien Loong), at least sometimes:

"He was still young and it was better that someone else succeed me as prime
minister. Then, were _Loong_ to make the grade later, it would be clear that
he made it on his own merit."

[http://www.singapore-window.org/sw04/040531a1.htm](http://www.singapore-
window.org/sw04/040531a1.htm)

(They use English in the family, although Lee Hsien Loong can speak Chinese
fairly well.)

~~~
kzrdude
His father called him by his first name, that sounds expected.

~~~
hboon
Hsien Loong is his first name. Chinese usually don't have middle names.
Calling him "Loong" is the equivalent of calling Tommy Tom. But it's more
intimate, usually only used by someone closer to the person.

------
danschuller
Singapore is a great place. Very meritocratic, high-tech, modern and forward-
looking but it _is_ a sort of benevolent dictatorship.

This is Lee Hsien Loong, the son of Lee Kuan Yew who built up Singapore
(obviously a brilliant leader but also, with little oversight, worryingly
quick to jail his critics). The People's Action Party (PAP) has been in power
since Singapore's formation and opposition party leaders have found themselves
in jail or sued into bankruptcy. Benevolent dictators and dynasties work great
until they don't.

It will be interesting to see how Singapore fares a few leaders down the line.
Hopefully pretty well and more politically tolerant; as it's a nice place with
great, talented people!

~~~
hackerboos
I was in Singapore this year and it's a fantastic place, but it is very
artificial. Citizens have a hard time communicating with each other through
the 4 very different official languages.

People are also on edge about immigration and the peaceful multicultural
facade hides a darker side of racism in Singapore.

~~~
clebio
This is an interesting comment, thank you for the perspective.

I think you mean 'facade' where you wrote 'fasard'? I don't want to assume,
though -- it might be a word I don't recognize, or transliteration -- honestly
asking.

~~~
hackerboos
You're right. Written in haste and not proof read.

------
shadowsun7
This isn't that surprising. Lee Hsien Loong studied at Trinity College,
Cambridge, where he was Senior Wrangler, and graduated with a first class
honours in mathematics and a Diploma in Computer Science (with distinction).

He's mentioned in the past that he briefly considered a career in academia
(Mathematics). That didn't happen, of course. (source:
[http://www.moe.gov.sg/media/speeches/2003/sp20030603.htm](http://www.moe.gov.sg/media/speeches/2003/sp20030603.htm))

~~~
Osmium
> where he was Senior Wrangler

For those unfamiliar with the term, this is a _huge_ achievement.

[http://en.wikipedia.org/wiki/Senior_Wrangler_(University_of_...](http://en.wikipedia.org/wiki/Senior_Wrangler_\(University_of_Cambridge\))

~~~
rurban
I edited the wikipedia entry to include that even a prime minister was Senior
Wrangler not only leading mathematicians and physicists. Good career
prospects. I can only think of recently killed Russian opposition politician
Boris Nemtsov with similar mathematical achievements.

Angela Merkel (Kasner) also won a mathematics price during her physics
doctorate studies, before she elected to work in agitprop and most likely as
master stasi spy under the codenames ANITA and Black Widow. Which brings me to
the theory that being a spy will help you more getting to a prime minister job
(Putin, Merkel), than being an excellent mathematician.

------
stared
Well, I know that this may sound unpopular, but Singapore is one of key
examples why technocracy may be better than democracy.

In democracy, it's popularity contest. It may be influenced by politicians'
technical skills; though, much more often it's influenced by their ideologies.
(If you think that popularity is the same as merit, then look at which current
songs are the most popular.)

And a large group of people have tendency to be biased towards short-term
goals rather than long-term progress.

~~~
devnonymous
Being an Indian (ie: coming from the largest democracy in the world), I have
formed the opinion that democracy is a form of government where in theory
everybody is happy most of the time but unfortunately what it instead does is
keeps everybody equally unhappy, all the time.

Now, whether this is necessarily a bad thing considering the alternatives is
debatable but coming to your point, yeah, something like Singapore just cannot
happen in a democracy although it is not due to the short-sightedness of the
'large group of people'.

In a proper democracy the minority opinion (note, I said minority opinion, not
minorities' opinion) no matter how flawed and unreasonable would still have to
be considered. Again, this is not necessarily a bad thing, it just slows
things down (in either direction !)

~~~
mike_hearn
I don't see any particular reason why a democracy cannot have tech-savvy
leaders. As often pointed out Angela Merkel was a chemist before becoming the
German Chancellor. Margaret Thatcher was also a chemist, I believe. Germany is
by all accounts very well run and is indeed a very tech-savvy and productive
economy.

I don't know anywhere else that has a computer scientist as a leader, but then
again, I suspect that's because most people who have a passion for mathematics
or computer science end up going into that field. Virtually nobody it seems
decides to leave the CS world for politics. This guy did only because of the
whole dynastic element - his father told him what he'd do in life, so he was
never able to pursue his skills in this field.

Sometimes I wonder if some of the political problems we often debate here on
HN and elsewhere are our own fault. So few people enter politics from the tech
and science industries, it should perhaps not surprise us much when
technically illiterate leaders pass nonsensical laws .

~~~
govindkabra
Not exactly a computer scientist, but I am hoping Sheryl Sandberg runs for the
office of President in the next decade.

------
lordnacho
Like many people in tech, I've come to the conclusion that managers need to
have done at least one component of whatever they're managing. Hopefully the
critical component, if there is one.

This is just as true for politicians, and I think this guy is a great example.
All this talk about advancing STEM education in the West, but which country is
leading? The one where the leader is a top STEM graduate.

Anecdata: I've been to Singapore several times, have loads of friends there.
They really are better educated than your average western adult.

~~~
Jugurtha
The following thought amused me:

The USSR had control over everything back in the day, though the hard sciences
and their people had great latitude and somehow enjoyed more freedom compared
to those in other domains. They were like little precious princesses.

That's because hard sciences are, well, too hard for your average Soviet
dictator to understand, control, and screw up. Not hard enough, apparently,
for the average Western politician in 2015.

~~~
varjag
> The USSR had control over everything back in the day, though the hard
> sciences and their people had great latitude and somehow enjoyed more
> freedom compared to those in other domains.

This was born out of necessity: the hard sciences were the weapons program,
first and foremost. Then, there's usually not much to argue in material world
from Communist POV. Unlike the soft/social sciences where there's much bigger
potential for subversive.

That said, they never had more "latitude" than their Western colleagues. There
were waves of crackdowns on supporters of relativist physics, on computer
science, on genetics. Korolev, the champion behind the Soviet space programme,
died from kidney condition resulting from his prison camp labor.

------
sh33mp
He also published a paper on economics quite a while back
([http://www.jstor.org/discover/10.2307/1882634](http://www.jstor.org/discover/10.2307/1882634))
on externalities. Not surprising, given the proactive Singapore government.

------
naithemilkman
Woohoo Singapore represent! Ok serious question though: is he the only world
leader that can code?

~~~
peteretep
Merkel was a physicist, so one would assume she has written at least some
code.

~~~
jpfr
Merkel wrote Fortran code for her PhD thesis. [1]

Afaik she approximated the Schrödinger equation to compute the rate of decay
of molecules with up to 6 atoms.

This [2] is the last physics paper of her (from 1990). After the wall fell,
her interests changed quite a bit... Only political papers from then on.

[1] [http://www.file-upload.net/download-9106454/AM-
Diss.pdf.html](http://www.file-upload.net/download-9106454/AM-Diss.pdf.html)

[2]
[http://dx.doi.org/10.1002%2Fqua.560380214](http://dx.doi.org/10.1002%2Fqua.560380214)

------
johnlinvc
He got Cambridge Diploma in Computer Science.

[1][http://en.wikipedia.org/wiki/Lee_Hsien_Loong#Background_and_...](http://en.wikipedia.org/wiki/Lee_Hsien_Loong#Background_and_education)

------
ronyeh
Jump to the sudoku solver section:
[https://www.youtube.com/watch?v=49YeHvJ6yZg&t=9m33s](https://www.youtube.com/watch?v=49YeHvJ6yZg&t=9m33s)

------
kragen
Charlemagne didn’t know how to read for most of his life, and was studying
assiduously in order to become literate at the time of his death; nowadays
that would be unthinkable. But today we’re in the same situation with most of
our political leaders and programming: Obama was able to remember at least
that bubble sort was the wrong way to sort a million integers, but didn’t even
come close to the constant-time radix sort you’d want to use (if we’re talking
about fixnums, not bignums). A lot of people will use this situation to argue
that dictatorship is better than democracy, since Singapore has dictatorship
and smart leaders, while the democratic world generally has programming-
illiterate leaders (except Merkel, apparently), but that seems to be more a
coincidence than anything else — Lee’s level of competence is as much an
anomaly among dictators as it would be among democratic leaders.

Political leadership (whether in a democracy or in a dictatorship) is about
persuading people to cooperate with each other, not about reading and writing,
except perhaps as a means to that persuasion, and not about programming,
either. But the extent to which you can rightly aim your cooperative efforts
depends crucially on your understanding of the world in which they will play
out, and when it comes to that, political leaders lacking basic informatics
competence are as mentally crippled in the 21st century as an illiterate
political leader like Charlemagne would have been in the 19th. Nobody really
occupies the role of “history’s actors” that Karl Rove believed he was in. We
are all constrained to be in the reality-based community, or fail as he did.

~~~
Apocryphon
It's just culture. The U.S., maybe the Anglosphere in general, lacks the same
esteem for engineers and technologists that much of the rest of the world has.
So you're less likely to see such people rise in American politics. I don't
think it's a matter about democracy vs. technocratic dictatorships.
Ahmadinejad was a civil engineer, Angela Merkel was a research scientist, and
who's the only presidential candidate with a CS degree in the 2012 elections?
Herman Cain.

------
devy
And please don't forget, at an annual salary of $1.7 million USD [1], Mr. Lee
Hsien Loong is also the world's HIGHEST PAID prime minister.

So I am not surprised that he should have some additional chops to be amongst
the highest paid world political leaders.

[1]:
[http://en.wikipedia.org/wiki/Lee_Hsien_Loong#Salary](http://en.wikipedia.org/wiki/Lee_Hsien_Loong#Salary)

------
Yadi
This guy is such an inspiration. Perhaps a different side of Politics. Well at
least from where I come from originally.

He wants to build a data marketplace, invest in tech R&D )since 2010). OH and
he also programs in Haskell.

I mean this is amazing how he have dedicated so much for this topic.

------
cyphunk
Meanwhile, Obama has a child teach him how to open the Processing.org IDE.
Meh, maybe the future is brighter though considering Hiliary knows how to
setup her own mail server.

~~~
spacemanmatt
Maybe we should require the same of each congressman and senator, then come
back to this question.

------
richerlariviere
What about Stephen Harper. Haha. Computer science should be part of all prime
minister's knowledge. It brings rationality and analytic thinking.

------
rurban
But he calls his sysadmins a "Cyber Security Agency". Looks like typical
government overreach to me.

------
mali_budo
My father, a machine engineer, built a wooden chair out of oak last week

------
haosdent
LoL, amazing!

------
seivan
Singapore keeps impressing me.

~~~
iewnait
How so?

