Archive for the 'topcoder' Category

Monster dan kelinci

Hari Kamis minggu lalu, TopCoder mengadakan babak kualifikasi ke-I algoritma untuk TopCoder Open 2008 yang akan diadakan bulan Mei yang akan datang. Lumayan alhamdulillah masih bisa lolos. Mudah-mudahan masih bisa dapet kaos meskipun kelihatannya cukup sulit.

Yang menarik dari babak kualifikasi ini adalah soalnya. Terutama soal paling mudahnya yang bernilai 250. Soalnya diberi nama “Monsters and bunnies” jadi kalau di-Indonesia-kan kira-kira jadi “monster dan kelinci”. Problem statementnya kira-kira seperti ini (lengkapnya bisa diperoleh di sini):

Di sebuah kota, ada tiga jenis makhluk hidup. Kamu, x ekor monster dan y ekor kelinci. Jika monster bertemu kelinci, monster agak membunuh kelinci. Jika monster bertemu monster, mereka akan bertarung hingga keduanya mati. Jika moster bertemu kamu, kamu akan dibunuh juga oleh monster. Jika kamu dan kelinci bertemu, kamu bisa memilih untuk membunuh kelinci tersebut atau tidak.

Pertanyaannya: Jika x dan y diberikan, berapa probabilitas kamu untuk hidup?

Bingung? Tidak usah bingung. Ini persoalan cetek sebenarnya… asal tahu triknya :P Jawaban akhirnya 1/(x+1) jika x genap dan 0 untuk kasus lain.

Nah loh… kok bisa pertanyaan probabilitas yang kelihatannya rumit itu jawabannya jadi sederhana? Disinilah menariknya soal ini. Banyak koder yang menyangka bahwa faktor kelinci harus diperhitungkan dalam menentukan hasil akhir. Ini juga didukung dengan contoh-contoh soal yang kelihatannya seperti menjebak para koder.

Bila dilihat dari contoh soal, jelas bahwa jika x = 0 maka probabilitas kamu tetap hidup adalah 1 karena kelinci tidak dapat membunuh kamu dan sudah pasti kamu akan tetap hidup. Sebaliknya jika jumlah monster ganjil, maka kamu sudah pasti mati karena biar bagaimanapun kamu berusaha dan biar bagaimanapun jumlah kelinci, bakal ada satu monster yang akhirnya membunuh kamu. Yang menarik baru jika jumlah monster genap, karena kamu masih punya kesempatan hidup. Masalahnya adalah berapa besar kesempatan itu? Jawaban akhirnya seperti yang telah dikemukakan diatas hanya dipengaruhi oleh jumlah monster.

Hal ini seperti menimbulkan kontroversi di antara para peserta kualifikasi. Well, biasanya soal-soal TopCoder jarang yang tricky seperti ini, atau kalaupun ada biasanya nilainya lebih besar alias tingkat kesulitannya lebih tinggi. Banyak di antara peserta yang tidak sadar bahwa jumlah kelinci tidak berpengaruh terhadap hasil akhir. Dan karena ini soal ini soal paling mudah, mereka lebih konsentrasi untuk menjawab dua soal lain yang lebih sulit.

Kontes algoritma di TopCoder menarik karena selain babak koding, juga ada babak challenge di mana kita bisa melihat jawaban peserta lain dan men-challenge jawaban peserta lain tersebut. 50 poin tambahan akan diperoleh jika challenge berhasil dan -25 jika challenge gagal.

Dengan soal yang sedikit ‘nakal’ seperti itu, babak challenge jadi benar-benar luar biasa. Banyak koder yang berhasil men-challenge jawaban koder lain. Tentunya mereka yang men-challenge sebagian besar adalah mereka yang sadar bahwa kelinci sama sekali tidak berpengaruh terhadap hasil akhir. Hasilnya benar-benar menakjubkan… prosentase keakuratan jawaban soal yang seharusnya paling mudah ini menjadi dibawah 40%.

Dan itu tidak selesai sampai disana. Diskusi terus berlanjut. Salah satu yang tersadar bahwa kelinci tidak berpengaruh hanya bisa mengumpat tertahan, ‘Stupid irrelevant bunnies’. Yang masih belum yakin terus mendebat dengan berbagai cara dan meminta pembuktian matematika. Singkatnya buat saya, problem ini benar-benar problem 250 paling menarik yang pernah saya lihat. Atau malah benar-benar problem paling menarik yang pernah saya lihat.

Penulis soal ini sampai harus menulis editorial yang cukup panjang untuk soal ini. FYI, biasanya untuk soal termudah editorialnya hanya berkisar 5 sampai 10 baris. Tapi kali ini, sang penulis benar-benar mengeksplorasi semua kemungkinan jawaban dari yang paling mudah seperti disampaikan di atas, sampai mereka yang berniat mengaplikasikan dynamis programming untuk soal ini.

Begitu serunya perdebatan, sampai hari ini pun masih banyak bermunculan anekdot-anekdot lucu di forum TopCoder (mungkin ini juga kenapa saya suka dengan TopCoder. Selera humor mereka benar-benar luar biasa). Mungkin sayangnya untuk benar-benar mengerti letak kelucuan anekdot tersebut, kita harus cukup aktif mengikuti forum.

Beberapa thread yang paling menarik:

Thread ini dibuat untuk mengumumkan keberhasilan TopCoder melobi pemerintah US supaya peserta dari negara-negara seperti Iran (yang diembargo US) bisa ikut bertanding di TCO.

So now that TopCoder is involved in international politics when are we going to start seeing diplomatic contests where TopCoder members compete to solve the world’s political problems?

Well, we already saw that it’s surprisingly hard to solve the world’s monsters and bunnies problem.

Judul thread ini adalah You know you are a TopCoder when …. Isinya adalah ciri-ciri apa saja yang membuat kamu bisa merasa bahwa kamu adalah TopCoder sejati. Macam-macam isinya, ada yang berkorban besar untuk ikut SRM (Single Round Match/ kompetisi mingguan TopCoder), tentang nama-nama besar di TopCoder, dan sebagainya. Setelah persoalan kelinci dan monster ini, ada post baru:

(You know you are a TopCoder when) … you are not surprised by the fact that a couple of very intelligent people are discussing if you should kill the bunnies.

(You know you are a TopCoder when) … you and another TopCoder get into a loud and animated discussion about killing bunnies in a lab full of astonished people who have no idea what you’re talking about. ;)

Hehehe.. sepertinya memang problem yang satu ini tidak akan bisa dilupakan dengan mudah oleh komunitas TopCoder.

Eight business technology trends to watch

McKinsey, one of the biggest management consultant, released a very interesting article Eight business technology trends to watch.
Continue reading ‘Eight business technology trends to watch’

Introducing: TopCoder Studio

Since several months ago , there is a new kind of competition in TopCoder. It’s called as TopCoder Studio. The competitions that are held varies from web designing, icon and logo creation, wireframe designing, etc. Your task is simply creating the design, submitting it, and waiting for the winner. If you win, TopCoder may ask you to do some modification and the money will be transferred to your bank account. For each competition, you will get some specification of the design. This may include how big is the design, the color that you may use, the font you may use and all other design aspect. And this varies from one competition to other.

Continue reading ‘Introducing: TopCoder Studio’

29th June 2007

29th June 2007 will be a very remarkable day for a long time. Well, at least for me.

The biggest news is of course that Apple launch its iPhone. I witnessed the queue in front of Apple Store in Las Vegas 8 hours before it officially launched.

Second thing, for those of you that uses Java. Eclipse Europa is launched in the same day. The press is not so big, maybe because of all Apple iPhone news. But it’s here with all new features that are very tempting, especially those Mylyn offered. This plugin is the first project that got included in standard distribution of Eclipse Java Package.

The last, 29th June 2007 is also big day for TopCoder. The winner of TCO07 is announced and I got the opportunity to see the magnificent event myself. See the official blog to know more about it. But you probably already screwed if you miss the webcast.

TopCoder Open 2007

TopCoder Open (TCO 2007) has been started. TopCoder Open is a set of competition, both online and on site (for the finals), held by TopCoder, open to anyone, who is at least 18 years old.

Usually, there are only two tracks in the competition, but this year there will be two additional tracks added to the competition, Marathon Match and Studio. In summary, there are 4 tracks in the competition:

  1. Algorithm Competition, this is the most common and the most popular tracks. Basically, you will be given some problems to be solved. This competition much or less is similar to what are International Olympiad in Informatics or ACM competition.
  2. Component Development, contains design and development. This is the most unique software engineering approach in the world.
  3. Marathon Match. Don’t have the speed that algorithm competition needs? Maybe you kind of programming the right things slowly? This is the right track for you. The problem doesn’t have exact solution and its up to you to use any kind of techniques to improve the result.
  4. Studio. If you’re not a programmer but have some design skill, this is the right track for you.

Welcome to the competition atmosphere! ;)

TCCC 2006 Onsite Competition

TC

If you never heard of TopCoder, it is one of online judges for algorithm competition. These days they held a very big event, TopCoder College Competition 2006, and currently it has finished semifinal round and tomorrow we will watch who is the best college programmer in the world.

Continue reading ‘TCCC 2006 Onsite Competition’