Wednesday, May 2, 2012

Insertion Sort

Insertion Sort 

 Salah satu algoritma sorting yang paling sederhana adalah insertion sort. Ide dari algoritma ini dapat dianalogikan seperti mengurutkan kartu. Penjelasan berikut ini menerangkan bagaimana algoritma insertion sort bekerja dalam pengurutan kartu. Anggaplah anda ingin mengurutkan satu set kartu dari kartu yang bernilai paling kecil hingga yang paling besar. Seluruh kartu diletakkan pada meja, sebutlah meja ini sebagai meja pertama, disusun dari kiri ke kanan dan atas ke bawah. Kemudian kita mempunyai meja yang lain, meja kedua, dimana kartu yang diurutkan akan diletakkan. Ambil kartu pertama yang terletak pada pojok kiri atas meja pertama dan letakkan pada meja kedua. Ambil kartu kedua dari meja pertama, bandingkan dengan kartu yang berada pada meja kedua, kemudian letakkan pada urutan yang sesuai setelah perbandingan. Proses tersebut akan berlangsung hingga seluruh kartu pada meja pertama telah diletakkan berurutan pada meja kedua. Algoritma insertion sort pada dasarnya memilah data yang akan diurutkan menjadi dua bagian, yang belum diurutkan (meja pertama) dan yang sudah diurutkan (meja kedua). Elemen pertama diambil dari bagian array yang belum diurutkan dan kemudian diletakkan sesuai posisinya pada bagian lain dari array yang telah diurutkan. Langkah ini dilakukan secara berulang hingga tidak ada lagi elemen yang tersisa pada bagian array yang belum diurutkan.

Wednesday, April 25, 2012

Air Bersih


Air bersih adalah salah satu jenis sumberdaya berbasis air yang bermutu baik dan biasa dimanfaatkan oleh manusia untuk dikonsumsi atau dalam melakukan aktivitas mereka sehari-hari termasuk diantaranya adalah sanitasi
Untuk konsumsi air minum menurut departemen kesehatan, syarat-syarat air minum adalah tidak berasa, tidak berbau, tidak berwarna, dan tidak mengandung logam berat. Walaupun air dari sumber alam dapat diminum oleh manusia, terdapat risiko bahwa air ini telah tercemar oleh bakteri (misalnya Escherichia coli) atau zat-zat berbahaya. Walaupun bakteri dapat dibunuh dengan memasak air hingga 100 °C, banyak zat berbahaya, terutama logam, tidak dapat dihilangkan dengan cara ini.


Tuesday, April 24, 2012

Penemu Calculator

Penemu kalkulator pertama di dunia adalah Blaise Pascal. Ahli matematika dan sains dari Prancis itu berhasil membuat kalkulator roda numerik atau Pascaline. Alat tersebut menjadi cikal bakal kalkulator modern yang sering digunakan saat ini.



Menara Hanoi


Menara Hanoi adalah sebuah permainan matematis atau teka-teki. Permainan ini terdiri dari tiga tiang dan sejumlah cakram dengan ukuran berbeda-beda yang bisa dimasukkan ke tiang mana saja. Permainan dimulai dengan cakram-cakram yang tertumpuk rapi berurutan berdasarkan ukurannya dalam salah satu tiang, cakram terkecil diletakkan teratas, sehingga membentuk kerucut.
Tujuan dari teka-teki ini adalah untuk memindahkan seluruh tumpukan ke tiang yang lain, mengikuti aturan berikut:
  • Hanya satu cakram yang boleh dipindahkan dalam satu waktu.
  • Setiap perpindahan berupa pengambilan cakram teratas dari satu tiang dan memasukkannya ke tiang lain, di atas cakram lain yang mungkin sudah ada di tiang tersebut.
  • Tidak boleh meletakkan cakram di atas cakram lain yang lebih kecil.

Teka Teki Einstein


Teka teki ini tidak mengandung trik, hanya murni logika.
Baca petunjuk yang ada, karena akan sangat membantu untuk menemukan jawabannya.
jangan cepat menyerah!
Ada 5 buah rumah yang masing-masing memiliki warna berbeda.
Setiap rumah dihuni satu orang pria dengan kebangsaan yang berbeda-beda.
Setiap penghuni menyukai satu jenis minuman terntentu.
Merokok satu merk rokok tertentu.
Serta memelihara satu jenis hewan tertentu.
Tidak ada satupun dari kelima orang tersebut yang memiliki warna rumah yang sama
minum minuman yang sama,
merokok merk rokok yang sama,
serta memelihara hewan yang sama seperti penghuni yang lain.
Pertanyaannya sederhana sekali : Siapakah yang memelihara IKAN?
Petunjuk:

Algoritma Kriptografi Caesar Cipher


Dalam bidang ilmu kriptografi terdapat algortima yang menjadi fungsi dasarnya, yaitu :
  1. Enkripsi, merupakan pengamanan data yang dikirimkan agar terjaga kerahasiaannya. Pesan asli
        disebut plaintext, yang diubah menjadi kode – kode yang tidak bisa dimengerti. Dalam hal ini
        enkripsi disebut juga dengan cipher atau kode.
  2. Dekripsi, merupakan kebalikan dari enkripsi. Pesan yang telah dienkripsi dikembalikan ke bentuk
        asalnya (teks-asli), disebut dengan dekripsi pesan. Algoritma yang digunakan untuk dekripsi
        tentu berbeda dengan algoritma yang digunakan untuk dekripsi.
  3. Kunci, yang dimaksud di sini adalah kunci yang dipakai untuk melakukan enkripsi dan dekripsi.
        Kunci terbagi menjadi dua bagian yaitu kunci rahasia (private key) dan kunci umum (public key).
  • Tentang Sandi Kaisar (Caesar Cipher)

Monday, April 23, 2012

Indonesia's Forests


Indonesia's Forests in Brief

Indonesia has lost an estimated 72 percent of its original frontier forest. 

Indonesia is experiencing one of the highest rates of tropical forest loss in the world.

   Indonesia was still densely forested as recently as 1950. Forty percent of the forests existing in 1950 were cleared in the following 50 years. In round numbers, forest cover fell from 162 million ha to 98 million ha.
   The rate of forest loss is accelerating. On average, about 1 million ha per year were cleared in the 1980s, rising to about 1.7 million ha per year in the first part of the 1990s. Since 1996, deforestation appears to have increased to an average of 2 million ha per year.
   Indonesia’s lowland tropical forests, the richest in timber resources and biodiversity, are most at risk. They have been almost entirely cleared in Sulawesi and are predicted to disappear in Sumatra by 2005 and Kalimantan by 2010 if current trends continue.
  Nearly one half of Indonesia’s forests are fragmented by roads, other access routes, and such developments as plantations.

Deforestation in Indonesia is largely the result of a corrupt political and economic system that regarded natural resources, especially forests, as a source of revenue to be exploited for political ends and personal gain.

  Logging concessions covering more than half the country’s total forest area were awarded by former President Suharto, many of them to his relatives and political allies. Cronyism in the forestry sector left timber companies free to operate with little regard for long-term sustainability of production.
  As part of the effort to boost Indonesia’s export revenues, and to reward favored companies, at least 16 million ha of natural forest have been approved for conversion to industrial timber plantations or agricultural plantations. In many cases, conversion contradicted legal requirements that such plantations be established only on degraded land or on forest land already allocated for conversion.
  Aggressive expansion of Indonesia’s pulp and paper industries over the past decade has created a level of demand for wood fiber that cannot currently be met by any sustainable domestic forest management regime.
  Forest clearance by small-scale farmers is a significant but not dominant cause of deforestation.

Illegal logging has reached epidemic proportions as a result of Indonesia’s chronic structural imbalance between legal wood supply and demand.

  Illegal logging, by definition, is not accurately documented. But a former senior official of the Ministry of Forestry recently claimed that theft and illegal logging have destroyed an estimated 10 million ha of Indonesian forests.
  Massive expansion in the plywood, pulp, and paper production sectors over the past two decades means that demand for wood fiber now exceeds legal supplies by 35-40 million cubic meters per year.
  This gap between legal supplies of wood and demand is filled by illegal logging. Many wood processing industries openly acknowledge their dependence on illegally cut wood, which accounted for approximately 65 percent of total supply in 2000.
  Legal logging is also conducted at an unsustainable level. Legal timber supplies from natural production forests declined from 17 million cubic meters in 1995 to under 8 million cubic meters in 2000, according to recent statistics from the Ministry of Forestry. The decline has been offset in part by timber obtained from forests cleared to make way for plantations. But this source appears to have peaked in 1997.
  Industrial timber plantations have been widely promoted and subsidized as a means of supplying Indonesia’s booming demand for pulp and taking pressure off natural forests. In practice, millions of hectares of natural forest have been cleared to make way for plantations that, in 75 percent of cases, are never actually planted.

More than 20 million hectares of forest have been cleared since 1985, but the majority of this land has not been put to productive alternative uses.

  Nearly 9 million ha of land, much of it natural forest, have been allocated for development as industrial timber plantations. This land has already been cleared or will be cleared soon. Yet only about 2 million ha have actually been planted with fast-growing species, mostly Acacia mangium, to produce pulpwood. The implication: 7 million ha of former forest land are lying idle.
  Nearly 7 million ha of forest had been approved for conversion to estate crop plantations by the end of 1997, and this land has almost certainly been cleared. But the area actually converted to oil palm plantations since 1985 is about 2.6 million hectares, while new plantations of other estate crops probably account for another 1-1.5 million ha. The implication: 3 million ha of former forest land are lying idle.
  No accurate estimates are available for the area of forest cleared by small-scale farmers since 1985, but a plausible estimate in 1990 suggested that shifting cultivators might be responsible for about 20 percent of forest loss. This would translate to clearance of about 4 million ha between 1985 and 1997.
  The transmigration program that relocated people from densely populated Java to the outer islands was responsible for about 2 million ha of forest clearance between the 1960s and the program’s end in 1999. In addition, illegal migration and settlement by pioneer farmers at the margins of logging concessions, along roads, and even in national parks has greatly accelerated since 1997, but reliable national-scale estimates of forest clearance by forest pioneers have not been made.
  Large-scale plantation owners have turned to the use of fire as a cheap and easy means of clearing forest for further planting. Deliberate fire-setting, in combination with unusually dry conditions caused by El NiƱo events, have led to uncontrolled wildfires of unprecedented extent and intensity. More than 5 million ha of forest burned in 1994 and another 4.6 million ha burned in 1997-98. Some of this land is regenerating as scrubby forest, some has been colonized by small-scale farmers, but there has been little systematic effort to restore forest cover or establish productive agriculture.

The Indonesian Government is facing mounting pressure domestically and internationally to take action, but progress is slow and not all policy reforms in process are necessarily good news for forests.

  In the freer political atmosphere that followed the fall of President Suharto in 1998, environmental activists have demanded greater accountability from both the government and the private sector. Access to official information has improved, but efforts to prevent the worst abuses of corporate power have met with limited success.
  Numerous forest-dependent communities, sensing the weakening of central power, have erupted violently against logging and plantation operations that they consider to be plundering their local resources. Longstanding problems of unclear land tenure rights are the root cause of many such conflicts. The government is no longer willing to protect corporate interests as it once did, but neither does it appear to have any coordinated plan for dealing with the problem.
  Since 1999, Indonesia’s principal aid donors have coordinated their assistance through a consortium called the Consultative Group on Indonesia (CGI), chaired by the World Bank. Improved forest management has been declared a priority, and the Government of Indonesia has committed to a 12-point plan of policy reform. But continuing political turmoil seems likely to undermine these efforts. In April 2001, the then-Forestry Minister acknowledged many failures, saying that Indonesia should not have agreed to “such unrealistic targets.” As one example, the government imposed a moratorium on further conversion of natural forest in May 2000, but the ban is widely disregarded in the provinces.
  Indonesia is moving rapidly toward a new system of “regional autonomy,” but the provincial and district governments that will benefit from decentralization are largely without the capacities or funds needed to govern effectively. Raising short-term revenue will be a top priority and, as a result, intensified exploitation of forest resources is already occurring in many regions.