<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Adi masmudi on Medium]]></title>
        <description><![CDATA[Stories by Adi masmudi on Medium]]></description>
        <link>https://medium.com/@adimasmudi?source=rss-18e7f201fea9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XMgUIIG_8fxU8LVKnDOy0g.jpeg</url>
            <title>Stories by Adi masmudi on Medium</title>
            <link>https://medium.com/@adimasmudi?source=rss-18e7f201fea9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 17:08:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adimasmudi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Stop Using Nested Loops: A Guide to the Two-Pointer Algorithm]]></title>
            <link>https://medium.com/@adimasmudi/stop-using-nested-loops-a-guide-to-the-two-pointer-algorithm-7070b048d6f6?source=rss-18e7f201fea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/7070b048d6f6</guid>
            <category><![CDATA[two-pointers]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Adi masmudi]]></dc:creator>
            <pubDate>Sun, 09 Nov 2025 14:06:35 GMT</pubDate>
            <atom:updated>2025-11-09T14:06:35.786Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*byWnGMSX1i1a8beK.png" /><figcaption>Source: <a href="https://towardsdatascience.com/">https://towardsdatascience.com</a></figcaption></figure><p>When faced with a problem involving arrays or strings, what’s our first instinct? Often, it’s a nested loop. While this brute-force approach works, it frequently leads to a time complexity of O(N^2), which can be too slow for large datasets.</p><p>But what if there was a way to solve many of these problems in a single pass?</p><p>Enter the <strong>Two-Pointer technique</strong>. It’s not a complex algorithm in itself, but rather a simple, powerful <em>approach</em> to problem-solving. The idea is to use two variables (the “pointers”) to move through a data structure, working together to solve the problem in O(N) time, often with O(1) extra space.</p><p>This approach can transform a complex-looking problem into a clean and efficient solution. Let’s break down the most common patterns.</p><h3>1. The “Opposite Direction” Pattern</h3><p>This is the most common pattern. You initialize one pointer at the beginning of an array (the “left” pointer) and another at the end (the “right” pointer). They then move toward each other, narrowing the search space until they meet or cross.</p><p>This pattern is ideal for problems where you need to find a pair of values or check for symmetry.</p><h4>Example: Valid Palindrome</h4><p>A classic example is checking if a string is a palindrome (reads the same forwards and backward), ignoring non-alphanumeric characters.</p><pre>def is_palindrome(s: str) -&gt; bool:<br>    l, r = 0, len(s) - 1<br>    while l &lt; r:<br>        # Skip non-alphanumeric characters from the left<br>        while l &lt; r and not s[l].isalnum():<br>            l += 1<br>        # Skip non-alphanumeric characters from the right<br>        while l &lt; r and not s[r].isalnum():<br>            r -= 1<br>        <br>        # Compare the two &quot;valid&quot; characters<br>        if s[l].lower() != s[r].lower(): <br>            return False<br>        <br>        # Move pointers inward<br>        l += 1<br>        r -= 1<br>    return True</pre><h3>2. The “Same Direction” (Fast/Slow) Pattern</h3><p>In this pattern, both pointers start at or near the beginning of the array but move at different speeds. The “fast” pointer does the work of exploring the array, while the “slow” pointer keeps track of the “correct” position for the next valid element.</p><p>This pattern is perfect for problems involving duplicate removal, sorting in-place, or finding cycles.</p><h4>Example: Remove Duplicates from Sorted Array</h4><p>Given a sorted array, we want to remove the duplicates in-place such that each unique element appears only once. The function should return the new “length” of the modified array.</p><p>The slow pointer keeps track of the last unique element, and the fast pointer scouts ahead.</p><pre>def remove_duplicates(arr: list[int]) -&gt; int:<br>    # The slow pointer marks the end of the unique-element subarray<br>    slow = 0<br>    # The fast pointer iterates through the entire array<br>    for fast in range(len(arr)):<br>        # If we find a new unique element<br>        if arr[fast] != arr[slow]:<br>            # Move the slow pointer forward<br>            slow += 1<br>            # &quot;Insert&quot; the new unique element at the slow pointer&#39;s position<br>            arr[slow] = arr[fast]<br>            <br>    # The new length is the index of the last unique element + 1<br>    return slow + 1</pre><h3>Beyond the Basics: Related Optimization Patterns</h3><p>Once you’re comfortable with these two core patterns, you’ll see them adapted into other powerful algorithms that also optimize away nested loops.</p><h3>1. The Sliding Window</h3><p>The Sliding Window technique uses two pointers (often left and right) to define a &quot;window&quot; over a data structure. This window expands (by moving right) and contracts (by moving left) to find the longest, shortest, or optimal substring/subarray that satisfies a certain condition.</p><p><strong>Example: Longest Substring Without Repeating Characters</strong></p><pre>from collections import defaultdict<br><br>def longest_substring_without_repeating_characters(s: str) -&gt; int:<br>    longest = 0<br>    l = 0<br>    counter: dict[str, int] = defaultdict(int)<br>    <br>    for r in range(len(s)):<br>        # Add the new character to our window&#39;s count<br>        counter[s[r]] += 1<br>        <br>        # If this character&#39;s count is now &gt; 1, it&#39;s a repeat.<br>        # We must shrink the window from the left until it&#39;s valid again.<br>        while counter[s[r]] &gt; 1:<br>            counter[s[l]] -= 1<br>            l += 1<br>            <br>        # Update the longest valid window we&#39;ve seen<br>        longest = max(longest, r - l + 1)<br>        <br>    return longest</pre><h3>2. Cycle Finding (Floyd’s Tortoise and Hare)</h3><p>This is a brilliant adaptation of the fast/slow pointer pattern, most famously used to detect a cycle in a linked list. The “tortoise” pointer moves one step at a time, while the “hare” moves two. If there’s a cycle, the hare will eventually lap the tortoise.</p><pre>class Node:<br>    def __init__(self, val, next=None):<br>        self.val = val<br>        self.next = next<br><br>def node_next(node):<br>    return node.next or node<br><br>def has_cycle(nodes: Node) -&gt; bool:<br>    if not nodes or not nodes.next:<br>        return False<br>        <br>    tortoise = node_next(nodes)<br>    hare = node_next(node_next(nodes))<br>    <br>    while tortoise != hare and hare.next is not None and hare.next.next is not None:<br>        tortoise = node_next(tortoise)<br>        hare = node_next(node_next(hare))<br>        <br>    return hare.next is not None and hare.next.next is not None</pre><h3>3. Prefix Sum + Hash Map</h3><p>While not strictly a two-pointer technique, the Prefix Sum pattern is another common way to optimize array problems that might otherwise seem to require nested loops. It uses a hash map to store running totals (prefix sums) and their indices. This allows you to find the sum of any subarray in O(1) time.</p><p><strong>Example: Subarray Sum Equals Target</strong></p><p>Given an array of integers and a target integer, find a <em>continuous</em> subarray that sums to the target.</p><pre>def subarray_sum(arr: list[int], target: int) -&gt; list[int]:<br>    # prefix_sums will store {running_sum: index}<br>    prefix_sums = {0: 0}<br>    cur_sum = 0<br>    <br>    for i in range(len(arr)):<br>        cur_sum += arr[i]<br>        complement = cur_sum - target<br>        <br>        # If the complement (cur_sum - target) exists in our map,<br>        # it means the sum between prefix_sums[complement] and i is the target.<br>        if complement in prefix_sums:<br>            return [prefix_sums[complement], i + 1]<br>            <br>        prefix_sums[cur_sum] = i + 1<br>        <br>    return []</pre><h3>Conclusion</h3><p>The Two-Pointer approach, in all its variations, is more than just a trick; it’s a new way of thinking. It teaches you to see array and string problems not as static blocks of data, but as dynamic landscapes you can traverse from multiple directions at once.</p><p>The next time you find yourself writing a nested loop, ask yourself: <strong>“Can this be solved with two pointers?”</strong></p><p>The answer might just save you a lot of time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7070b048d6f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How i use timetable to maintain productivity]]></title>
            <link>https://medium.com/@adimasmudi/how-i-use-timetable-to-maintain-productivity-5873fbbc8176?source=rss-18e7f201fea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/5873fbbc8176</guid>
            <category><![CDATA[life-goals]]></category>
            <category><![CDATA[habbits]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Adi masmudi]]></dc:creator>
            <pubDate>Sun, 02 Nov 2025 10:46:47 GMT</pubDate>
            <atom:updated>2025-11-02T10:46:47.457Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A person feel overwhelmed with tasks" src="https://cdn-images-1.medium.com/max/735/1*O0DOJR_dpwSsNIrkom456Q.jpeg" /><figcaption>Source: Pinterest</figcaption></figure><p>We all feel it: the world is moving at breakneck speed. It feels like we don’t have time to breathe as new technologies, tools, and AI models appear almost daily. This is a world our parents never experienced, and it demands a new approach to building our lives and careers.</p><p>There’s a constant pressure to keep up, to learn the next trend, and to do everything just to make sure we don’t fall behind. This pressure can be paralyzing. It’s hard to figure out what to do first, what to learn next, or how to maintain a single new habit. We’re left wondering if our daily actions are even moving us toward the life we truly want.</p><p>All of us have at least one major goal, whether it’s buying a new car, traveling to a new country, or landing a dream job. And that’s when the classic problem strikes: we have the goal, but no clear system to get there.</p><p>I was in that exact boat for years. I had dozens of goals related to my career and self-development, but I had no system to measure my progress or even know which actions were effective. I was just setting goals and hoping for the best.</p><p>That’s when I decided to stop drifting and start building my system.</p><h3>System Over Goal</h3><h4>Core Idea</h4><p>I’m a huge fan of James Clear’s <em>Atomic Habits</em>. The core idea — that building a <em>system</em> of small, daily improvements is the key, not just setting goals — was a complete game-changer for me.</p><p>My first attempts at building a system were a mess. I tried everything. I used the Pomodoro technique, meticulously time-blocked my entire day, and stuffed my Google Calendar with tasks. I downloaded a dozen different to-do list apps, each promising a new way to be organized.</p><p>The result? I was completely overwhelmed. I was spending more time <em>managing</em> my productivity tools than actually <em>doing work</em>. And that’s when it hit me: <strong>I was overthinking how to be productive, and it was making me unproductive.</strong></p><p>I realized I didn’t need more apps or complex techniques. I just needed a simple timetable.</p><p>My solution is an evolution of time-blocking. The idea is simple: I categorize my day into broad sections — like “Morning Routine,” “Deep Work,” or “Learning Something New” — and then plug my to-do list items into those sections. It’s not about scheduling every minute, but about creating a simple, flexible, adjustable, and sustainable framework for my day</p><figure><img alt="Time Category" src="https://cdn-images-1.medium.com/max/987/1*nwyDDkNM8AnY1WBiNBq9Wg.png" /><figcaption>Image: Time Category</figcaption></figure><h4>Here is how it works</h4><p>As a quick disclaimer: I’m an early bird and have my best focus in the morning. My timetable is built around that, starting with deep work in the morning and moving to lighter learning in the evening. Your blocks might look different, and that’s the point! The key is flexibility.</p><p>This is what each section means for me:</p><ul><li><strong>Morning Routine:</strong> This is the time I use to get ready for the day. It includes activities like prayer, meditation, checking email, light stretching, or even a quick gym session. These aren’t part of my core job, but they are mandatory for my well-being and set a positive tone.</li><li><strong>Deep Focus:</strong> This is my peak focus time. I use it for work or learning that requires full, uninterrupted attention — tackling hard concepts, doing difficult work, or reading something complex. No distractions allowed.</li><li><strong>Practical Thing:</strong> I find I get sleepy in the afternoon if I’m doing passive work (like just reading). I use this block for <em>active</em>, hands-on tasks, which for me is usually coding. It keeps my energy up and prevents that post-lunch slump.</li><li><strong>Do the Hard Thing:</strong> Later in the afternoon, my energy returns, and I use this block to tackle other challenging tasks. This could be finishing a complex feature, reviewing code before a deployment, or creating detailed notes for the next day’s work.</li><li><strong>Learn Something New:</strong> This is my personal development time. I use it to learn about new topics that interest me, whether that’s watching a podcast, taking a video tutorial, reading a technical book, or working on a personal project.</li><li><strong>Wind Down:</strong> It’s time to wrap up the day and plan for tomorrow. During this time, I’m shutting down my devices and getting ready for bed. Sometimes I’ll read a (physical) book, but the goal is to disconnect</li></ul><h4>Putting It All Together: My Weekly Schedule</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*T73TpLCFwguTU3WnftOQKQ.png" /><figcaption>image: turn time category into actionable timetable</figcaption></figure><h4>The Result: From Chaos to Confidence</h4><p>This timetable is the actual implementation of my system. It helps me track my activity and gives me a clear plan for what to do each day.</p><p>Again, the key is flexibility. The schedule can be adjusted based on my current situation, whether I have a weekend event or something unexpected prevents me from studying in the evening. But the core idea is clear: I wanted to structure my day and create a system that aligns with my yearly and monthly goals.</p><p>After just a couple of months, I already feel better. I can clearly see my progress and know I’m growing. The final results aren’t here yet, but I’m confident I’ll achieve my goals because I finally have a great system.</p><p>Maybe I’ll write a follow-up article next year to report on how this timetable has changed my life — and whether I hit those big goals.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5873fbbc8176" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Perbedaan antara Document Object Model (DOM) dan Browser Object Model (BOM)]]></title>
            <link>https://medium.com/gdsc-trunojoyo/perbedaan-antara-document-object-model-dom-dan-browser-object-model-bom-b0554133735d?source=rss-18e7f201fea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0554133735d</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[dom]]></category>
            <dc:creator><![CDATA[Adi masmudi]]></dc:creator>
            <pubDate>Sun, 07 Aug 2022 13:50:40 GMT</pubDate>
            <atom:updated>2022-08-28T10:55:44.686Z</atom:updated>
            <content:encoded><![CDATA[<p>Terlihat serupa tapi sebenarnya tidak sama. Ternyata ada perbedaan antara document object model dan juga browser object model, lho. Berikut penjelasannya, silahkan disimak ygy :)</p><figure><img alt="DOM and BOM" src="https://cdn-images-1.medium.com/max/777/1*DkAmt44dGXGJ3vriwoVJGg.jpeg" /><figcaption>Gambar DOM dan BOM</figcaption></figure><p>Satu hal yang mungkin kalian perhatikan adalah bahwa saya tidak membuat judul dengan narasi perbandingan (menggunakan ‘vs’) tapi dengan penyandingan (menggunakan ‘dan’). Hal itu karena BOM dan DOM bukanlah metode yang berbeda yang dapat kita pilih mana yang ingin dipakai seperti layaknya react vs vue atau laravel vs node.js, melainkan 2 hal saling berkaitan atau bahkan digunakan secara bersamaan.</p><p>Ok, mari kita simak pengertian masing-masing ya.</p><p><strong>Document Object Model (DOM)</strong></p><p>Document Object Model adalah kumpulan dari beberapa object yang mana meliputi struktur ataupun isi dari sebuah dokumen pada suatu website. DOM bisa juga disebut sebagai API yang memiliki beberapa fungsi untuk melakukan manipulasi pada struktur, isi, <em>style</em>, dan sebagainya pada suatu dokumen dalam sebuah website. DOM merepresentasikan dokumen seperti sebuah simpul yang dapat digunakan oleh bahasa pemrograman (biasanya javascript) untuk berinteraksi dengan dokumen pada sebuah website.</p><figure><img alt="DOM" src="https://cdn-images-1.medium.com/max/486/1*LA6AXbzvC0IQ_d2H8v3NCw.gif" /><figcaption>Struktur DOM</figcaption></figure><p>Contoh dari simpul pada dokumen bisa dilihat pada gambar di atas. Document berada di paling atas sebagai induk, sementara itu terdapat beberapa chiil di bawahnya. Child tersebut adalah sebuah elemen HTML yang berada di dalam elemen lain (induknya). Dengan bahasa pemrograman javascript, terdapat beberapa cara untuk mengakses elemen DOM, yaitu : menggunakan id, class, atau bahkan tag html itu sendiri.</p><p><strong>Browser Object Model (BOM)</strong></p><p>Berbeda dengan DOM yang berbasis pada dokumen, BOM adalah sebuah cara bagi bahasa pemrograman untuk melakukan manipulasi pada browser secara langsung. Biasanya yang digunakan adalah window. Beberapa hal yang sering dilakukan adalah mengecek event pada window dengan window.addEventListener atau mengecek lebar atau tinggi dari window untuk selanjutnya dilakukan manipulasi menggunakan window.innerHeight dan window.innerWidth.</p><figure><img alt="bom" src="https://cdn-images-1.medium.com/max/847/1*fTcg9Akc56opLO919QoIZw.jpeg" /><figcaption>Struktur BOM</figcaption></figure><p><strong>Kesimpulan</strong></p><p>Baik DOM dan juga BOM bisa digunakan secara bersamaan karena keduanya saling terkait. Jika yang dibutuhkan adalah melakukan perubahan pada dokumen atau element HTML seperti isi konten, struktur, atau style maka konsep DOM yang akan digunakan. Akan tetapi, jika ternyata yang diperlukan adalah manipulasi atau pengambilan informasi pada browser seperti tinggi window, lokasi, history, dll maka konsep BOM yang akan digunakan. :)</p><p>Okey, sekian untuk hari ini. Terimakasih sudah membaca :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0554133735d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gdsc-trunojoyo/perbedaan-antara-document-object-model-dom-dan-browser-object-model-bom-b0554133735d">Perbedaan antara Document Object Model (DOM) dan Browser Object Model (BOM)</a> was originally published in <a href="https://medium.com/gdsc-trunojoyo">GDSC Trunojoyo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Alasan kenapa standar deviasi adalah cara terbaik untuk mengukur sebaran distribusi data]]></title>
            <link>https://medium.com/gdsc-trunojoyo/alasan-kenapa-standar-deviasi-adalah-cara-terbaik-untuk-mengukur-sebaran-distribusi-data-a8cf3845114c?source=rss-18e7f201fea9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8cf3845114c</guid>
            <category><![CDATA[standard-deviation]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[statistik]]></category>
            <dc:creator><![CDATA[Adi masmudi]]></dc:creator>
            <pubDate>Sat, 11 Jun 2022 03:49:13 GMT</pubDate>
            <atom:updated>2022-06-14T06:07:15.442Z</atom:updated>
            <content:encoded><![CDATA[<p>halo temen2, kali ini aku mau share sedikit tentang materi statistik dasar yaitu distribusi data. Meskipun mungkin materinya sedikit dan dasar diharapkan dapat mudah dimengerti dan saya akan berusaha untuk menjelaskannya dengan cara yang sederhana agar mudah dimengerti, bahkan oleh mereka yang pertama kali belajar statistik. So, tanpa berlama-lama mari kita mulai materinya.</p><p>Distribusi data pada dasarnya adalah bagaimana sebuah data disajikan atau diperlihatkan. Data-data tersebut biasanya paling sering dibentuk histogram, bar chart atau bahkan tabel frekuensi. Nah, penyajian data tersebut biasanya dapat juga memperlihatkan banyaknya data pada keadaan tertentu, range, atau bahkan penyimpangan datanya. Untuk lebih jelasnya bisa dilihat pada gambar di bawah ini:</p><figure><img alt="distribusi data dengan bar chart" src="https://cdn-images-1.medium.com/max/665/1*oOza2KP5GrePYAOyfqUJfg.jpeg" /><figcaption>distrbusi data dengan bar chart</figcaption></figure><figure><img alt="distribusi data dengan tabel frekuensi" src="https://cdn-images-1.medium.com/max/359/1*FaIJL5bzHWQeKyNhDp9NxA.jpeg" /><figcaption>distribusi data dengan tabel frekuensi</figcaption></figure><p>Nah, gambar di atas menunjukkan cara penyajian data menggunakan bar chart dan juga tabel frekuensi. Pada kasus pencarian sebaran data, kedua data tersebut bisa saja digunakan, akan tetapi menggunakan bar chart akan lebih mudah untuk divisualisasikan.</p><p>Ok, setelah mengetahui apa itu distribusi data, sekarang kita cari tahu apa itu sebaran data dan untuk apa digunakan. So, sebaran data pada dasarnya adalah selisih antara suatu nilai tertentu terhadap nilai tengah atau pun rata-ratanya. Penggunaan atau pencarian sebaran data ini digunakan untuk menunjukkan seberapa jauh sebuah data menyebar terhadap nilai rata-rata atau nilai tengahnya (saya bilang nilai tengah karena sangat mungkin nilai rata-rata adalah nilai tengah data). Gambar contoh dari sebaran data bisa dilihat pada gambar di bawah ini:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*zj_2jL2sTgli9YoK6SDlJg.png" /><figcaption>contoh sebaran data</figcaption></figure><p>Gambar di atas adalah pengukuran tinggi dari hewan peliharaan yang divisualisasikan. Jika kita anggap garis hijau adalah rata-rata dari tinggi hewan peliharaan pada gambar, maka objek berwarna merah adalah tinggi dari setiap hewan peliharaan. Maka, jarak dari objek berwarna merah ke garis berwarna hijau adalah sebaran atau penyimpangan datanya. Seperti terlihat pada gambar di bawah ini:</p><figure><img alt="sebaran data 2" src="https://cdn-images-1.medium.com/max/781/1*AKgNeleQyyYhfbRmmWAN6A.png" /><figcaption>gambar sebaran data</figcaption></figure><p>Nah, dalam hal pencarian penyimpangan data yang paling populer adalah simpangan rata-rata dan juga simpangan baku atau standar deviasi. Lalu, apa perbedaan antara kedua cara pengukuran penyimpangan tersebut? well, let’s go kita bahas.</p><p>Penyimpangan rata-rata adalah pengukuran suatu nilai terhadap rata-rata dari distribusi data tersebut. Singkatnya, semua nilai dikurangi dengan rata-rata kemudian dijadikan nilai mutlak (jarak tidak mungkin negatif). Ok, mari kita mulai sedikit demi sedikit menghitung. Note: disini saya akan menggunakan pendekatan kalimat daripada penghitungan dengan menampilkan rumus.</p><p>Pada nilai di atas, rata-rata dapat dihitung dengan menjumlahkan seluruh tinggi hewan menjadi 600 + 470 + 170 + 430 + 300 = 1970, kemudian nilai hasil penjumlahan tersebut dibagi dengan banyaknya hewan yaitu 5, sehingga hasilnya menjadi 1970/5=394. Ok, kita sudah tau berapa rata-ratanya, sekarang kita bisa cari nilai simpangannya.</p><p>Pada perhitungan penyimpangan rata-rata dilakukan pengurangan setiap nilai distribusi terhadap nilai rata-rata, sehinga menjadi:</p><p>|600–394| + |470–394| + |170–394| + |430–394| + |300–394| = 636</p><p>Hasilnya kemudian dibagi dengan banyaknya data, yaitu 5 sehingga hasilnya menjadi : 636/5=127.2.</p><p>Yeps, sekarang kita sudah mengetahui bahwa penyimpangan rata-rata yang sudah kita dapatkan adalah 127.2. Sekarang kita, akan membandingkan dengan standar deviasi sekaligus penjabaran alasan kenapa standar deviasi adalah yang terbaik untuk pengukuran penyimpangan atau sebaran data.</p><p>Standar deviasi memiliki cara penghitunga yang hampir mirip dengan simpangan rata-rata, perbedaannya adalah jika pada simpangan rata-rata setiap nilai hasil pengurangan dengan rata-rata di mutlakkan sedangkan pada simpangan baku atau standar deviasi nilainya dikuadratkan. Alasan pengkuadradan nilai daripada dimutlakkan karena standar deviasi biasanya diasosiasikan dengan nilai rata-rata aritmatika yang mana nilai tersebut meminimalkan jumlah perbedaan kuadratnya (mungkin bisa kita bahas lain kali hehe). Setelah data tersebut dikurangi dengan nilai rata-rata dan dikuadratkan, maka selanjutnya tambahkan semua datanya kemudian bagi dengan banyaknya data. (dalam beberapa kasus juga bisa dibagi dengan banyaknya data -1, penentuannya dari penggunaan data apakah data tersebut adalah populasi atau sampel). Jika dilakukan dengan cara tersebut, maka yang kita dapatkan adalah variansinya, untuk mendapatkan nilai standar deviasinya kita bisa akarkan variansi tersebut.</p><p>Ok, dengan data yang sama maka kita bisa dapatkan standar deviasinya sebagai berikut:</p><p>(600–394)² + (470–394)² + (170–394)² + (430–394)² + (300–394)², sehingga nilai yang didapat adalah 108.520. Setelah itu, kita bagi dengan banyaknya data yaitu 5, sehingga hasilnya adalah 21.704.</p><p>Ok sekarang kita sudah mendapatkan nilai variansinya. Nah, untuk mendapatkan nilai standar deviasnya yang bisa kita lakukan adalah mengakarkan nilai variansinya, sehingga hasil yang didapat adalah √21.704 = 147.32…</p><p>Kita lakukan saja pembulatan sehingga menjadi 147. Kemudian muncul pertanyaan. Nilai penyimpangan rata-rata dan standar deviasi berbeda? lalu mana yang paling benar?</p><p>Well, dalam hal ini akan saya bilang nilai standar deviasi adalah lebih benar yang bisa kita buktikan di bawah ini:</p><p>Dalam pencarian nilai rata-rata dengan menjumlahkan nilai, nilai negatif akan menghilangkan nilai positif dengan angka yang sama. contoh:</p><p>4 + 4 -4 -4 = 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/146/1*Q-iJGxF3M1KoS6ULVHTJZQ.png" /><figcaption>nilai penyimpangan data absolute karena semua nilai sama</figcaption></figure><p>sehingga simpangan rata-ratanya akan tetap bernilai 4 karena punya 4 nilai sama jika di mutlakkan. Terlihat bagus untuk kasus ini, lalu bagaimana dengan kasus lain, contohnya:</p><p>7,1,-6–2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/146/1*Eaj_XMVA-62X96kLkARfVw.png" /><figcaption>Penyimpangan data harusnya bukan lagi 4, tapi menyebar lebih jauh</figcaption></figure><p>rata-rata dari nilai di atas adalah 0. kemudian jika kita hitung simpangan rata-ratanya akan didapatkan 16/4 = 4. so, nilainya tetap 4, padahal data tersebut harusnya mimiliki penyimpangan yang lebih menyebar. Seperti terlihat pada gambar.</p><p>Nah, sekarang kita coba hitung dengan standar deviasi, maka akan kita dapatkan hasil seperti berikut:</p><p>7²+1²+(-6)²+(-2)² = 49+1+36+4 = 90</p><p>√(90/4) = 4.74</p><p>Well, bisa kita lihat bahwa standar deviasi memiliki akurasi yang lebih baik untuk menghitung penyimpangan suatu data . Setidaknya memiliki penyimpangan data yang melebihi dari rata-rata pada nilai absolut. Sehingga, standar deviasi inilah yang memang lebih sering digunakan pada kasus-kasus di dunia nyata terutama di bidang data science.</p><p>Ok, terimakasih teman-teman sudah membaca artikel ini sampai selesai. Semoga bermanfaat, Jika ada kesalahan atau kekurangan mohon untuk berikan kritik atau saran. Sekian :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8cf3845114c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gdsc-trunojoyo/alasan-kenapa-standar-deviasi-adalah-cara-terbaik-untuk-mengukur-sebaran-distribusi-data-a8cf3845114c">Alasan kenapa standar deviasi adalah cara terbaik untuk mengukur sebaran distribusi data</a> was originally published in <a href="https://medium.com/gdsc-trunojoyo">GDSC Trunojoyo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>