<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Mathematics on Rafiul Alam</title>
    <link>https://alamrafiul.com/tags/mathematics/</link>
    <description>Recent content in Mathematics on Rafiul Alam</description>
    <image>
      <title>Rafiul Alam</title>
      <url>https://alamrafiul.com/papermod-cover.png</url>
      <link>https://alamrafiul.com/papermod-cover.png</link>
    </image>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sun, 02 Feb 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://alamrafiul.com/tags/mathematics/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Go Concurrency Pattern: The Sieve of Eratosthenes Pipeline</title>
      <link>https://alamrafiul.com/posts/go-sieve-eratosthenes/</link>
      <pubDate>Sun, 02 Feb 2025 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/posts/go-sieve-eratosthenes/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://alamrafiul.com/posts/go-monte-carlo-pi/&#34;&gt;← Monte Carlo Pi&lt;/a&gt; | &lt;a href=&#34;https://alamrafiul.com/concurrency-patterns/&#34;&gt;Series Overview&lt;/a&gt; | &lt;a href=&#34;https://alamrafiul.com/posts/go-mandelbrot-set/&#34;&gt;Mandelbrot Set →&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;the-problem-finding-primes-with-filters&#34;&gt;The Problem: Finding Primes with Filters&lt;/h2&gt;
&lt;p&gt;The Sieve of Eratosthenes is an ancient algorithm for finding prime numbers. The concurrent version creates a pipeline of filters: each prime spawns a goroutine that filters out its multiples.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Algorithm:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Generate sequence: 2, 3, 4, 5, 6, 7, 8, 9, 10, &amp;hellip;&lt;/li&gt;
&lt;li&gt;Take first number (2), it&amp;rsquo;s prime, filter all multiples of 2&lt;/li&gt;
&lt;li&gt;Take next number (3), it&amp;rsquo;s prime, filter all multiples of 3&lt;/li&gt;
&lt;li&gt;Take next number (5), it&amp;rsquo;s prime, filter all multiples of 5&lt;/li&gt;
&lt;li&gt;Repeat until desired count&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;The Beauty:&lt;/strong&gt; Each prime creates its own filter. Numbers flow through a pipeline of increasingly selective filters. What passes through all filters must be prime.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Go Concurrency Pattern: Monte Carlo Pi Estimation</title>
      <link>https://alamrafiul.com/posts/go-monte-carlo-pi/</link>
      <pubDate>Thu, 30 Jan 2025 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/posts/go-monte-carlo-pi/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://alamrafiul.com/posts/go-login-counter/&#34;&gt;← Login Counter&lt;/a&gt; | &lt;a href=&#34;https://alamrafiul.com/concurrency-patterns/&#34;&gt;Series Overview&lt;/a&gt; | &lt;a href=&#34;https://alamrafiul.com/posts/go-sieve-eratosthenes/&#34;&gt;Sieve of Eratosthenes →&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;the-problem-computing-pi-by-throwing-darts&#34;&gt;The Problem: Computing Pi by Throwing Darts&lt;/h2&gt;
&lt;p&gt;Imagine a square dartboard with a circle inscribed inside it. Throw random darts at the square. The ratio of darts landing inside the circle to total darts thrown approaches π/4.&lt;/p&gt;
&lt;p&gt;Why? &lt;strong&gt;Mathematics:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Square side length: 2 (from -1 to 1)&lt;/li&gt;
&lt;li&gt;Square area: 4&lt;/li&gt;
&lt;li&gt;Circle radius: 1&lt;/li&gt;
&lt;li&gt;Circle area: π × 1² = π&lt;/li&gt;
&lt;li&gt;Ratio: π/4&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Throw 1 million darts, multiply by 4, and you&amp;rsquo;ve estimated π. More darts = better estimate. This is &lt;strong&gt;Monte Carlo simulation&lt;/strong&gt;: using randomness to solve deterministic problems.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Go Concurrency Pattern: The Mandelbrot Set</title>
      <link>https://alamrafiul.com/posts/go-mandelbrot-set/</link>
      <pubDate>Mon, 27 Jan 2025 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/posts/go-mandelbrot-set/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://alamrafiul.com/posts/go-sieve-eratosthenes/&#34;&gt;← Sieve of Eratosthenes&lt;/a&gt; | &lt;a href=&#34;https://alamrafiul.com/concurrency-patterns/&#34;&gt;Series Overview&lt;/a&gt; | &lt;a href=&#34;https://alamrafiul.com/posts/go-collatz-explorer/&#34;&gt;Collatz Explorer →&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;the-problem-rendering-fractals-in-parallel&#34;&gt;The Problem: Rendering Fractals in Parallel&lt;/h2&gt;
&lt;p&gt;The Mandelbrot set is defined by a simple iterative formula:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Start with &lt;code&gt;z = 0&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Repeatedly compute &lt;code&gt;z = z² + c&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;|z|&lt;/code&gt; exceeds 2, the point escapes (not in the set)&lt;/li&gt;
&lt;li&gt;Color each pixel by iteration count&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The beauty:&lt;/strong&gt; Each pixel is completely independent. Perfect for parallelism!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The challenge:&lt;/strong&gt; Some pixels escape in 5 iterations, others take 1000+. This creates &lt;strong&gt;load imbalance&lt;/strong&gt;-some workers finish instantly while others grind away.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Go Concurrency Pattern: The Collatz Explorer</title>
      <link>https://alamrafiul.com/posts/go-collatz-explorer/</link>
      <pubDate>Mon, 20 Jan 2025 00:00:00 +0000</pubDate>
      
      <guid>https://alamrafiul.com/posts/go-collatz-explorer/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://alamrafiul.com/posts/go-mandelbrot-set/&#34;&gt;← Mandelbrot Set&lt;/a&gt; | &lt;a href=&#34;https://alamrafiul.com/concurrency-patterns/&#34;&gt;Series Overview&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;the-problem-the-simplest-unsolved-math-problem&#34;&gt;The Problem: The Simplest Unsolved Math Problem&lt;/h2&gt;
&lt;p&gt;The Collatz conjecture (3n+1 problem) is deceptively simple:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start with any positive integer n&lt;/li&gt;
&lt;li&gt;If n is even: divide by 2&lt;/li&gt;
&lt;li&gt;If n is odd: multiply by 3 and add 1&lt;/li&gt;
&lt;li&gt;Repeat until you reach 1&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;The conjecture:&lt;/strong&gt; Every positive integer eventually reaches 1.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example (n=12):&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;12 → 6 → 3 → 10 → 5 → 16 → 8 → 4 → 2 → 1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;The mystery:&lt;/strong&gt; This has been verified for numbers up to 2^68, but never proven. It&amp;rsquo;s one of mathematics&amp;rsquo; most famous unsolved problems.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
