Wednesday 12 February 2020

Binary Search (2)

For Example, the data is:
The key is 2

Record[1][2][3][4][5]
Data252116

First step: the data must be sorting. This sample, we can sort the data with bubble sort methods.

Record[1][2][3][4][5]
Data252116
Step 12521162 and 5, no Exchange
2521162 and 21, no Exchange
1521262 and 1, Exchange 
Step 21521265 and 21, no Exchange
1221562 and 5, Exchange
Step 31252165 and 21, Exchange
Step 412562121 and 6, Exchange
Second step: we can search data key 2 with binary search

New data:

Record [1][2][3][4][5]
Data125621

Step [1]:
                (low+high) div 2 =  (1+5) div 2
                                            =  6 div 2
                                            =  3
                the data on the record [3] is 5, then 5>3, next step swipe left


lowmiddlehigh
Record [1][2][3][4][5]
Data125621

Step [2]:   new_high = middle-1 =3 - 1 = 2
                (low + new_high) div 2 = (1+2) div 2
                                                    = 3 div 2
                                                    = 1
                the data on the record [1] is 1, then 1<2, next step swipe right


lownew_high
Record [1][2][3][4][5]
Data125621

Step [3]:  new_low = low + 1 = 2
                (new_low + new_high) div 2 = (2+2) div 2
                                                    = 4 div 2
                                                    = 2

new_low=new_high
Record [1][2][3][4][5]
Data125621

                the data on the record [2] is 2, end.

REseArCH 1

SISTEM PERHITUNGAN LAMA PENYINARAN MATAHARI DENGAN METODE OTSU THRESHOLD (STUDI KASUS: ST. KLIMATOLOGI BARONGAN)

Asih Pujiastuti, Agus Harjoko

Abstract

Solar radiation measurements in climatology station barongan done by using campbell stokes and record card. Solar radiation is the accumulation of the whole length of the object radiation recorded on the record card. Solar radiation data reading performed by observers by estimating the long of object irradiation compared with the scale of hours listed on the record card. The difficulties encountered by observers in conducting solar radiation data readout is the shape of the object radiation recorded on the record card are not always in the form of elongated areas, some areas disjointed, even can only form small holes along the track on the card record. The purpose of this study was to design and build a system that can be used to calculate solar radiation recorded on the card record, thus increasing the accuracy of measurement data readout. Cropping process is carried out in order to obtain the right area for analysis. The approach method in object segmentation is done by implementing a solar radiation threshold otsu method. The test results showed that the determination of the radius of the opening and removing noise value appropriately irradiation can obtain the number of objects on test images with RMSEof1.4429 compared with the amount of exposure o f the image of the original object. Results of calculation solar radiation by the system showed system RMSE o f 0,51 to observer calculation.

http://ejournals.stta.ac.id/index.php/compiler/article/view/166

Monday 10 February 2020

Binary Search (1)

For Example, the data is:
The key is 6

Record[1][2][3][4][5]
Data252116

First step: the data must be sorting. This sample, we can sort the data with bubble sort methods.

Record[1][2][3][4][5]
Data252116
Step 12521162 and 5, no Exchange
2521162 and 21, no Exchange
1521262 and 1, Exchange 
Step 21521265 and 21, no Exchange
1221562 and 5, Exchange
Step 31252165 and 21, Exchange
Step 412562121 and 6, Exchange
Second step: we can search data key 6 with binary search

New data:

Record [1][2][3][4][5]
Data125621


Step [1]:
                (low+high) div 2 =  (1+5) div 2
                                            =  6 div 2
                                            =  3---> middle
                the data on the record [3] is 5, then 5<6, next step swipe right


lowmiddlehigh
Record [1][2][3][4][5]
Data125621

Step [2]:  new_low = middle +1 = 3 +1 = 4
new_lowhigh
Record[1][2][3][4][5]
Data125621
                 
               (new_low + high) = (4+5) div 2
                                             = 9 div 2
                                             = 4
                the data on the record [4] is 6, then 6=6 , end.