Sabtu, 02 September 2023

Convert Decimal to Octal

With the same formula as binary we can also do it for base 8 (octal) numbers.

Example:

6710 = ……8 ?

  • First of all 67/8 = 8, remainder 3
  • Then 8/8 = 1, remainder 0,
  • Last 1/8=0, remainder 1.
  • Thus from the calculation results obtained 6710 = 1038

Jumat, 01 September 2023

Comparison of Euclidean Distance, Manhattan Distance and Minkowsky Distance

This time I will post a comparison of Euclidean distance, Manhattan distance and Minkowsky distance.
This is just a comparison.
The data to be used are as follows :


Perform the data calculation above using Euclidean distance, Manhattan distance and Minkowsky distance.
If you don't understand, you can see my previous post.
  • Euclidean Distance https://infmining.blogspot.com/2022/08/set-data-euclidean-distance.html
  • Manhattan distance https://infmining.blogspot.com/2022/08/set-data-jarak-manhattan.html
  • Minkowsky Distance https://infmining.blogspot.com/2022/09/set-data-jarak-minkowski.html

So the results we will get are as follows :


From the above results it is obtained that the Minkowsky Distance has a smaller value than the Manhattan Distance and also the Euclidean Distance.

Senin, 28 Agustus 2023

Konversi Desimal ke Oktal

 Dengan rumus yang sama seperti biner kita bisa lakukan juga untuk bilangan berbasis 8 (oktal).

Contoh:

6710 = ……8 ?
  1. Pertama-tama 67/8 = 8, sisa 3
  2. Lalu 8/8 = 1, sisa 0,
  3. Terakhir 1/8=0, sisa 1.
  4. Dengan demikian dari hasil perhitungan didaptkan 6710 = 1038


Jumat, 25 Agustus 2023

Calculation of K-Nearest Neighbor with Minkowski Distance (5 Criteria)

In this post, I will discuss the calculation of K-Nearest Neighbor with Minkowski Distance using 5 criteria.

The classification that will be discussed is the Classification of Scholarship Recipients.

The data we will use is:
  • Consists of 10 data
  • Consists of 5 criteria
  • K = 5
  • r Minkowski = 3


Information :
  • Which will be categorized consists of Mathematics scores, Indonesian scores, English scores, Science scores and Non-Academic scores.
  • Status consists of Not Qualified and Qualified.
  • What we will classify is Name = See, Mathematics Score = 81, Indonesian Score = 86, English Score = 79, Science Score = 93 and Non Academic Score = 87, Status = ?
 Calculation (formula to be used) :


  • 79 is Alan's Math score
  • 81 is See's Math score
  • 88 is Alan's Indonesian score
  • 86 is See's Indonesian score
  • 72 is Alan's British value
  • 79 is See's British value
  • 92 is Alan's Science score
  • 93 is See's Science score
  • 97 is Alan's Non-Academic score
  • 87 is See's Non-Academic score
  • Then do the same calculations on data belonging to Dani, Rey and so on.
  • 1/3 is the power for Minkowsky's formula
 Then the calculation will be obtained as follows :


After that, do the ranking from the smallest to the largest value, the results obtained are as follows :


After getting the ranking, we can ensure that on behalf of See is eligible to receive a Scholarship or Not Eligible to receive a Scholarship.


Explanation :
  • If using K = 1 then the result is not eligible because Moon the result is not eligible.
  • If using K=3 then the result is not eligible because Moon, Eks and Alan the results are not eligible (3 are not eligible).
  • If using K=5, the result is not eligible because Dani is eligible, while Moon, Eks, Alan and Zet are not eligible (full requirements totaling 1 and not fulfilling requirements totaling 4).
So the final result See does not meet the requirements


Notes :
  • The value of K is independent (try to have an odd number so it doesn't confuse us when there are the same number of voting results).

Rabu, 23 Agustus 2023

Convert Decimal to Binary

By using the calculation formula for converting decimal numbers to other bases, we can do the following.

Example :

6710 = ……2 ?

Suppose we are going to convert 67 base ten (decimal) to base 2 (binary).

1.     First we divide 67 by 2, we get the integer quotient is 33 with the remainder 1, or in other words 67 = 2*33 + 1

2.     Then we divide the integer quotient (33) by 2 again, 33/2 = 16, the remainder is 1.

3.     Then we repeat again, 16/2 = 8, the remainder is 0.

4.     Repeat these steps again until the integer quotient equals 0. After that, write down the remainder of the quotient starting from the bottom up.

Thus we will get that 6710 = 10000112.

Minggu, 20 Agustus 2023

Calculation of K-Nearest Neighbor with Manhattan Distance (5 Criteria)

In this post, I will discuss the calculation of K-Nearest Neighbor with Manhattan Distance using 5 criteria.

The classification that will be discussed is the Classification of Scholarship Recipients.

The data we will use is :

  • Consists of 10 data
  • Consists of 5 criteria
  • K = 5



Information :

  • What will be categorized consists of Mathematics scores, Indonesian B scores, English B grades, Science scores and Non-Academic scores.
  • Status consists of Not Qualified and Qualified.
  • What we will classify is Name = See, Mathematics Score = 81, Indonesian Score = 86, English Score = 79, Science Score = 93 and Non Academic Score = 87, Status = ?

 Calculation (formula to be used):



  • 79 is Alan's Math score
  • 81 is See's Math score
  • 88 is Alan's Indonesian score
  • 86 is See's Indonesian score
  • 72 is Alan's British value
  • 79 is See's British value
  • 92 is Alan's Science score
  • 93 is See's Science score
  • 97 is Alan's Non-Academic score
  • 87 is See's Non-Academic score
  • Then do the same calculations on data belonging to Dani, Rey and so on.

 Then the calculation will be obtained as follows :



After that, do the ranking from the smallest to the largest value, the results obtained are as follows :



After getting the ranking, we can ensure that on behalf of See is eligible to receive a Scholarship or Not Eligible to receive a Scholarship.



Explanation :

  • If using K=1 then the result is eligible because Dani the result is eligible.
  • If using K=3 then the result is not eligible because Dani's result is eligible, while Alan and Cee's results are not eligible (fulfilling the requirements is 1 and not fulfilling the requirements is 2).
  • If using K=5, the result is not eligible because Dani and Rey are eligible, while Alan, Cee and Eks are not eligible (2 meet the requirements and 3 do not meet the requirements).

So the final result See does not meet the requirements.



Notes :

  • The value of K is independent (try to have an odd number so it doesn't confuse us when there are the same number of voting results).

Kamis, 17 Agustus 2023

Konversi Desimal ke Biner

Dengan menggunakan rumus perhitungan konversi bilangan desimal ke basis lainnya kita bisa lakukan sebagai berikut.

Contoh :

6710 = ……2 ?

Misalkan kita akan melakukan konversi 67 basis sepuluh (desimal) ke dalam basis 2 (biner).
  1. Pertama-tama kita bagi 67 dengan 2, didapat bilangan bulat hasil bagi adalah 33 dengan sisa hasil bagi adalah 1, atau dengan kata lain 67 = 2*33 + 1
  2. Selanjutnya bilangan bulat hasil bagi tersebut (33) kita bagi dengan 2 lagi, 33/2 = 16, sisa hasil bagi
  3. Kemudian kita ulangi lagi, 16/2 = 8, sisa hasil bagi 0.
  4. Ulangi lagi langkah tersebut sampai bilangan bulat hasil bagi sama dengan 0. Setelah itu tulis sisa hasil bagi mulai dari bawah ke atas.
  5. Dengan demikian kita akan mendapatkan bahwa 6710 = 10000112.