Import Quarto posts and expand blog sync bridge
Some checks failed
Build / build (push) Has been cancelled
Some checks failed
Build / build (push) Has been cancelled
This commit is contained in:
parent
4ddaba7c7d
commit
e7227844c7
406 changed files with 7943 additions and 7637 deletions
|
|
@ -16,8 +16,47 @@ const BlogPosts = ({
|
|||
// Get the first post as the featured post
|
||||
const featuredPost = posts[0];
|
||||
const remainingPosts = posts.slice(1);
|
||||
const slugFor = (post: any) => post.id.replace(/\/index$/, "");
|
||||
const hrefFor = (post: any) =>
|
||||
collection ? `/${collection}/${post.id}/` : `/${post.id}/`;
|
||||
collection ? `/${collection}/${slugFor(post)}/` : `/${slugFor(post)}/`;
|
||||
|
||||
const PostVisual = ({
|
||||
post,
|
||||
featured = false,
|
||||
}: {
|
||||
post: any;
|
||||
featured?: boolean;
|
||||
}) => {
|
||||
if (post.data.image) {
|
||||
return (
|
||||
<img
|
||||
src={post.data.image}
|
||||
alt={post.data.title}
|
||||
className="aspect-video w-full rounded-lg object-cover transition-transform group-hover:scale-[1.02]"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="bg-accent/70 text-accent-foreground flex aspect-video w-full items-center justify-center rounded-lg border px-6 text-center">
|
||||
<span
|
||||
className={
|
||||
featured ? "font-fraunces text-2xl" : "font-fraunces text-lg"
|
||||
}
|
||||
>
|
||||
{post.data.title}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
if (!featuredPost) {
|
||||
return (
|
||||
<div className="text-muted-foreground container max-w-3xl py-16">
|
||||
No posts yet.
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="relative py-10 md:py-16 lg:py-20">
|
||||
|
|
@ -35,11 +74,7 @@ const BlogPosts = ({
|
|||
<div className="flex flex-col gap-6 lg:flex-row">
|
||||
<div className="lg:w-1/2">
|
||||
<div className="p-2 lg:p-4">
|
||||
<img
|
||||
src={featuredPost.data.image}
|
||||
alt={featuredPost.data.title}
|
||||
className="aspect-video w-full rounded-lg object-cover transition-transform group-hover:scale-[1.02]"
|
||||
/>
|
||||
<PostVisual post={featuredPost} featured />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col justify-center p-4 pb-8 lg:w-1/2 lg:pr-8">
|
||||
|
|
@ -89,11 +124,7 @@ const BlogPosts = ({
|
|||
href={hrefFor(post)}
|
||||
>
|
||||
<div className="p-2">
|
||||
<img
|
||||
src={post.data.image}
|
||||
alt={post.data.title}
|
||||
className="aspect-video w-full rounded-lg object-cover transition-transform group-hover:scale-[1.01]"
|
||||
/>
|
||||
<PostVisual post={post} />
|
||||
</div>
|
||||
<div className="px-4 pb-5 pt-2">
|
||||
<h2 className="mb-2 text-xl font-semibold group-hover:underline">
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
---
|
||||
title: "Algorithmic Sketches: Visualizing Data Structures"
|
||||
description: "Hand-drawn illustrations of algorithms and data structures - making the abstract tangible."
|
||||
pubDate: "Jan 25 2024"
|
||||
image: "https://images.unsplash.com/photo-1581337204873-ef36aa186caa?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Algorithmic Sketches: Visualizing Data Structures
|
||||
|
||||
Sometimes the best way to understand an algorithm is to draw it.
|
||||
|
||||
## Today's Sketch: Red-Black Trees
|
||||
|
||||

|
||||
|
||||
The rotation operation finally clicked when I drew it step-by-step. Each node's journey through the rotation becomes a story.
|
||||
|
||||
## The Process
|
||||
|
||||
1. Start with pencil - mistakes are part of learning
|
||||
2. Trace the algorithm's execution
|
||||
3. Add color to highlight invariants
|
||||
4. Annotate with key insights
|
||||
|
||||
## Why Drawing Helps
|
||||
|
||||
- Forces you to slow down and really see the structure
|
||||
- Reveals patterns that code obscures
|
||||
- Creates memorable mental models
|
||||
- Makes teaching more engaging
|
||||
|
||||
## This Week's Challenge
|
||||
|
||||
Draw your own version of quicksort partitioning. Share it and let's learn from each other's visualizations.
|
||||
|
||||
## The Art in Computer Science
|
||||
|
||||
Algorithms are beautiful. Drawing them reminds us that computer science is as much art as it is science.
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
---
|
||||
title: "Generative Art with p5.js: Creating Beauty from Mathematics"
|
||||
description: "Exploring the intersection of code and creativity through generative art experiments."
|
||||
pubDate: "Feb 18 2024"
|
||||
image: "https://images.unsplash.com/photo-1561070791-2526d30994b5?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Generative Art with p5.js: Creating Beauty from Mathematics
|
||||
|
||||
Code becomes canvas when mathematics meets creativity.
|
||||
|
||||
## Today's Creation: Perlin Noise Flows
|
||||
|
||||
```javascript
|
||||
for (let particle of particles) {
|
||||
let angle = noise(particle.x * 0.01, particle.y * 0.01, frameCount * 0.001) * TWO_PI;
|
||||
particle.velocity = p5.Vector.fromAngle(angle);
|
||||
particle.update();
|
||||
particle.draw();
|
||||
}
|
||||
```
|
||||
|
||||
## The Magic of Randomness
|
||||
|
||||
Controlled randomness creates organic patterns. Perlin noise gives us randomness with continuity - nature's own algorithm.
|
||||
|
||||
## Parameters as Paintbrushes
|
||||
|
||||
- Noise scale: Changes pattern density
|
||||
- Particle count: Affects texture
|
||||
- Color mapping: Sets the mood
|
||||
|
||||
## The Joy of Accidents
|
||||
|
||||
The best discoveries come from "mistakes" - a typo that creates unexpected beauty, a parameter pushed to extremes.
|
||||
|
||||
## Share Your Creations
|
||||
|
||||
Art is meant to be shared. Post your generative experiments and let's inspire each other.
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
---
|
||||
title: "Algorithms in Verse: Bubble Sort Sonnet"
|
||||
description: "Classic algorithms reimagined as poetry - where code meets iambic pentameter."
|
||||
pubDate: "Feb 22 2024"
|
||||
image: "https://images.unsplash.com/photo-1455390582262-044cdead277a?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Algorithms in Verse: Bubble Sort Sonnet
|
||||
|
||||
## Bubble Sort: A Sonnet
|
||||
|
||||
```
|
||||
Compare adjacent elements in pairs,
|
||||
If order's wrong, then swap them into place.
|
||||
Through all the list this simple rule declares:
|
||||
The largest bubbles up to find its space.
|
||||
|
||||
Again we start, but now one less to check,
|
||||
The second largest finds its rightful home.
|
||||
Each pass through makes the chaos less a wreck,
|
||||
Until at last no elements must roam.
|
||||
|
||||
Though simple in its elegance and grace,
|
||||
And easy for beginners to perceive,
|
||||
In practice, it's too slow to win the race—
|
||||
O(n²) we sadly must believe.
|
||||
|
||||
But beauty lies in simplicity's pure art,
|
||||
The bubble sort still teaches at the start.
|
||||
```
|
||||
|
||||
## The Challenge
|
||||
|
||||
Can you write Quicksort as a limerick? Or Binary Search as free verse?
|
||||
|
||||
## Why This Matters
|
||||
|
||||
Poetry forces us to find the essence of an algorithm. The constraint reveals understanding.
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
---
|
||||
title: "Code Haikus: Programming in 5-7-5"
|
||||
description: "Expressing programming concepts through the constrained beauty of haiku."
|
||||
pubDate: "Jan 30 2024"
|
||||
image: "https://images.unsplash.com/photo-1481627834876-b7833e8f5570?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Code Haikus: Programming in 5-7-5
|
||||
|
||||
The constraint of haiku forces clarity. Here are programming concepts distilled to their essence.
|
||||
|
||||
## On Recursion
|
||||
|
||||
```
|
||||
Function calls itself
|
||||
Smaller problems, same pattern
|
||||
Base case stops the loop
|
||||
```
|
||||
|
||||
## On Debugging
|
||||
|
||||
```
|
||||
Print statements bloom wild
|
||||
Binary search through the code
|
||||
Bug reveals itself
|
||||
```
|
||||
|
||||
## On Optimization
|
||||
|
||||
```
|
||||
O(n squared) crawls
|
||||
Refactor to n log n
|
||||
Time complexity
|
||||
```
|
||||
|
||||
## On Git Merge Conflicts
|
||||
|
||||
```
|
||||
<<<<<<< HEAD
|
||||
Your changes, their changes clash
|
||||
Resolution waits
|
||||
```
|
||||
|
||||
## On Learning
|
||||
|
||||
```
|
||||
Stack Overflow searched
|
||||
Tutorial incomplete
|
||||
Understanding dawns
|
||||
```
|
||||
|
||||
## Your Turn
|
||||
|
||||
Write a haiku about your coding experience today. The constraint reveals truth.
|
||||
27
sites/poetry/src/content/poetry/poems/bloom/index.md
Normal file
27
sites/poetry/src/content/poetry/poems/bloom/index.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
title: "Bloom"
|
||||
description: "Velvet-like violet erupts in a riot on miniscule white canvases harp-like; focused at a bunch of seeds. All trouble to no avail, one day the bee will come and take it all away...."
|
||||
pubDate: "2005-02-03"
|
||||
authorName: "Neeldhara"
|
||||
sourceCategories: ["poem"]
|
||||
sourcePath: "poems/bloom/index.qmd"
|
||||
---
|
||||
|
||||
Velvet-like violet<br>
|
||||
erupts<br>
|
||||
in a riot<br>
|
||||
on miniscule<br>
|
||||
white canvases<br>
|
||||
harp-like;<br>
|
||||
focused at<br>
|
||||
a bunch of seeds.<br>
|
||||
|
||||
All trouble<br>
|
||||
to no avail,<br>
|
||||
one day the bee will come<br>
|
||||
and take it all away.<br>
|
||||
|
||||
|
||||
---
|
||||
|
||||
Honorable Mention in the [The Binnacle Second Annual Ultra Short Competition](https://www.amazon.in/Binnacle-Second-Annual-Ultra-Short-Competition-ebook/dp/B06WVBTYC9).
|
||||
40
sites/poetry/src/content/poetry/poems/dad/index.md
Normal file
40
sites/poetry/src/content/poetry/poems/dad/index.md
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
title: "Dad"
|
||||
description: "The vendor at the counter hands me a stapler, wondering why I need yet another. Indeed, I didn't, until I realized that she giggles when I get frantic about lost pencils, papers..."
|
||||
pubDate: "2012-08-27"
|
||||
authorName: "Neeldhara"
|
||||
sourceCategories: ["poem"]
|
||||
sourcePath: "poems/dad/index.qmd"
|
||||
---
|
||||
|
||||
The vendor<br>
|
||||
at the counter<br>
|
||||
hands me a stapler,<br>
|
||||
wondering why<br>
|
||||
I need yet another.<br>
|
||||
<br>
|
||||
Indeed, I didn't,<br>
|
||||
until I realized<br>
|
||||
<br>
|
||||
that she giggles <br>
|
||||
when I get frantic<br>
|
||||
about lost pencils,<br>
|
||||
papers, and staplers<br>
|
||||
<br>
|
||||
and she smiles<br>
|
||||
indignantly<br>
|
||||
whenever I look,<br>
|
||||
exasperated,<br>
|
||||
<br>
|
||||
at her tiny hands<br>
|
||||
clutched around <br>
|
||||
the stuff she found.<br>
|
||||
<br>
|
||||
I am just bringing home<br>
|
||||
another situation<br>
|
||||
inviting her indignation,<br>
|
||||
<br>
|
||||
that eventually<br>
|
||||
turns into<br>
|
||||
a bear hug<br>
|
||||
of pure love.<br>
|
||||
35
sites/poetry/src/content/poetry/poems/letting-go/index.md
Normal file
35
sites/poetry/src/content/poetry/poems/letting-go/index.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
title: "Letting Go"
|
||||
description: "ख्वाब हे वो माशूका जो तुझे मिलने से रहा, हकीकत हे वो हमसफर जिसे तुने है ठुकरा दिया सपनों का घर है नींदो मे उन्हे वहीं तू छोड दे जो हकीकत सम्झोता लगे वहीं सुकून है जान ले --- A d..."
|
||||
pubDate: "2023-05-11"
|
||||
authorName: "Neeldhara"
|
||||
sourceCategories: ["poem"]
|
||||
sourcePath: "poems/letting-go/index.qmd"
|
||||
---
|
||||
|
||||
ख्वाब हे वो माशूका<br>
|
||||
जो तुझे मिलने से रहा,<br>
|
||||
हकीकत हे वो हमसफर<br>
|
||||
जिसे तुने है ठुकरा दिया<br>
|
||||
|
||||
सपनों का घर है नींदो मे<br>
|
||||
उन्हे वहीं तू छोड दे<br>
|
||||
जो हकीकत सम्झोता लगे<br>
|
||||
वहीं सुकून है जान ले<br>
|
||||
|
||||
---
|
||||
|
||||
A dream is an elusive enchantment;<br>
|
||||
while that that is to be treasured<br>
|
||||
is what has been for real<br>
|
||||
and is easily ignored.<br>
|
||||
|
||||
But a mere figment of imagination,<br>
|
||||
a dream is captive and binding:<br>
|
||||
let it go to be free from<br>
|
||||
your quest never-ending.<br>
|
||||
|
||||
|
||||
---
|
||||
|
||||
_Inspired by Pallavi Mahajan's [brilliant poetry](https://www.youtube.com/watch?v=M6mmF8OM9SM)._
|
||||
18
sites/poetry/src/content/poetry/poems/on-the-fence/index.md
Normal file
18
sites/poetry/src/content/poetry/poems/on-the-fence/index.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
title: "On the Fence"
|
||||
description: "At least you are dead. To which the ghost said, The grass is not greener here - But it did become paler there… At least you have a chance, To wait for the rains’ dance, To live..."
|
||||
pubDate: "2012-04-23"
|
||||
authorName: "Neeldhara"
|
||||
sourceCategories: ["poem"]
|
||||
sourcePath: "poems/on-the-fence/index.qmd"
|
||||
---
|
||||
|
||||
At least you are dead.<br>
|
||||
To which the ghost said,<br>
|
||||
The grass is not greener here -<br>
|
||||
But it did become paler there…<br>
|
||||
|
||||
At least you have a chance,<br>
|
||||
To wait for the rains’ dance,<br>
|
||||
To live and fight,<br>
|
||||
To make things right.<br>
|
||||
19
sites/poetry/src/content/poetry/poems/poetry/index.md
Normal file
19
sites/poetry/src/content/poetry/poems/poetry/index.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
title: "Poetry"
|
||||
description: "collect your grief and inject it in words spill them on paper and shred it to tatters to piece yourself together ---"
|
||||
pubDate: "2024-01-01"
|
||||
authorName: "Neeldhara"
|
||||
sourceCategories: ["poem"]
|
||||
sourcePath: "poems/poetry/index.qmd"
|
||||
---
|
||||
|
||||
collect your grief<br>
|
||||
and inject it<br>
|
||||
in words<br>
|
||||
<br>
|
||||
spill them on paper<br>
|
||||
and shred it to tatters<br>
|
||||
to piece yourself together<br>
|
||||
|
||||
|
||||
---
|
||||
37
sites/poetry/src/content/poetry/poems/seek/index.md
Normal file
37
sites/poetry/src/content/poetry/poems/seek/index.md
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
title: "Seek"
|
||||
description: "Seek poetry in a wisp of smoke, or closure in some ashes stories below newspaper headlines peace after bygone deadlines a castle in the air a choice that is fair the absence of..."
|
||||
pubDate: "2007-04-03"
|
||||
authorName: "Neeldhara"
|
||||
sourceCategories: ["poem"]
|
||||
sourcePath: "poems/seek/index.qmd"
|
||||
---
|
||||
|
||||
Seek poetry<br>
|
||||
in a wisp of smoke,<br>
|
||||
or closure<br>
|
||||
in some ashes<br>
|
||||
|
||||
stories below<br>
|
||||
newspaper headlines<br>
|
||||
peace after<br>
|
||||
bygone deadlines<br>
|
||||
|
||||
a castle<br>
|
||||
in the air<br>
|
||||
a choice<br>
|
||||
that is fair<br>
|
||||
|
||||
the absence of regret<br>
|
||||
on a death bed<br>
|
||||
a reason, or otherwise<br>
|
||||
to stay alive ---<br>
|
||||
|
||||
and quite likely<br>
|
||||
it will be<br>
|
||||
a quest unfulfilled.<br>
|
||||
|
||||
Find a smile instead,<br>
|
||||
and you will find<br>
|
||||
some strength to stay<br>
|
||||
another day.<br>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
title: "Sprinkles of the Sky"
|
||||
description: "A dubious draft of air comes, goes as if wondering if the air’s welcoming Soft rays tiptoe by the window as if shy to come inside Sprinkles of the sky lie in drops of dew as if..."
|
||||
pubDate: "2011-01-05"
|
||||
authorName: "Neeldhara"
|
||||
sourceCategories: ["poem"]
|
||||
sourcePath: "poems/sprinkles-of-the-sky/index.qmd"
|
||||
---
|
||||
|
||||
A dubious draft of air<br>
|
||||
comes, goes<br>
|
||||
as if wondering<br>
|
||||
if the air’s welcoming<br>
|
||||
|
||||
Soft rays tiptoe<br>
|
||||
by the window<br>
|
||||
as if shy<br>
|
||||
to come inside<br>
|
||||
|
||||
Sprinkles of the sky<br>
|
||||
lie in drops of dew<br>
|
||||
as if captive,<br>
|
||||
somewhat pensive<br>
|
||||
|
||||
And I snuggle deeper<br>
|
||||
into a distant dream<br>
|
||||
as if I could see<br>
|
||||
a better place to be<br>
|
||||
|
||||
---
|
||||
|
||||
<sub>I stole the title from a phrase in Hairat, [a song](https://www.youtube.com/watch?v=oz6LoxmLJTY) that features in [Anjaana Anjaani](https://en.wikipedia.org/wiki/Anjaana_Anjaani). Incidentally - I am very addicted to the entire album!</sub>
|
||||
26
sites/poetry/src/content/poetry/poems/winning/index.md
Normal file
26
sites/poetry/src/content/poetry/poems/winning/index.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
title: "Winning"
|
||||
description: "if you find a thing that is so that whoever has it can't keep it and whoever doesn't have it can always get it back then this a thing that is to be avoided in the beginning ---"
|
||||
pubDate: "2024-01-13"
|
||||
authorName: "Neeldhara"
|
||||
sourceCategories: ["poem"]
|
||||
sourcePath: "poems/winning/index.qmd"
|
||||
---
|
||||
|
||||
if you find a thing <br>
|
||||
that is so that <br>
|
||||
<br>
|
||||
whoever has it<br>
|
||||
can't keep it<br>
|
||||
<br>
|
||||
and <br>
|
||||
<br>
|
||||
whoever doesn't have it<br>
|
||||
can always get it back<br>
|
||||
<br>
|
||||
then this a thing<br>
|
||||
that is to be avoided<br>
|
||||
in the beginning<br>
|
||||
|
||||
|
||||
---
|
||||
|
|
@ -1,183 +0,0 @@
|
|||
---
|
||||
title: "The 100 Prisoners Problem: A Beautiful Puzzle in Probability"
|
||||
description: "An interactive exploration of one of the most counterintuitive puzzles in probability theory, where 100 prisoners can escape with over 30% chance using a clever strategy."
|
||||
pubDate: "Oct 13 2025"
|
||||
image: "https://images.unsplash.com/photo-1589829545856-d10d557cf95f?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
import PrisonerGameSimulator from '@/components/problems/PrisonerGameSimulator.tsx';
|
||||
import ProbabilityChart from '@/components/problems/ProbabilityChart.tsx';
|
||||
import PermutationExplorer from '@/components/problems/PermutationExplorer.tsx';
|
||||
import StrategyComparison from '@/components/problems/StrategyComparison.tsx';
|
||||
|
||||
# The 100 Prisoners Problem
|
||||
|
||||
Imagine 100 prisoners, numbered 1 to 100, face an unusual challenge. In a room are 100 boxes, also numbered 1 to 100. Inside each box is a randomly assigned number from 1 to 100 (each number appearing exactly once). The prisoners must find their own number by opening boxes, but here's the catch: **each prisoner can open only 50 boxes**.
|
||||
|
||||
The prisoners can devise a strategy beforehand, but once the challenge begins, they cannot communicate. If **all 100 prisoners** find their number, everyone goes free. If even one prisoner fails, all remain imprisoned.
|
||||
|
||||
What's the best strategy? And what are the odds of success?
|
||||
|
||||
## Try It Yourself!
|
||||
|
||||
Before we dive into the mathematics, let's experience the problem firsthand. Below is a simulator where you can play the game yourself. Choose the number of prisoners (between 5 and 100), and then try to help each prisoner find their number by clicking on boxes.
|
||||
|
||||
<PrisonerGameSimulator client:only="react" />
|
||||
|
||||
---
|
||||
|
||||
## The Naive Strategy
|
||||
|
||||
The most obvious approach is for each prisoner to simply open 50 random boxes. This seems reasonable, but the probability of success is dismal.
|
||||
|
||||
For any single prisoner, the probability of finding their number in 50 random boxes out of 100 is exactly 1/2. Since all 100 prisoners must succeed, and their outcomes are independent under random selection, the probability that everyone succeeds is:
|
||||
|
||||
$$P(\text\{success\}) = \left(\frac\{1\}\{2\}\right)^\{100\} \approx 7.9 \times 10^\{-31\}$$
|
||||
|
||||
That's essentially zero! You're more likely to win the lottery while being struck by lightning... multiple times.
|
||||
|
||||
### Naive Strategy: Probability vs Number of Prisoners
|
||||
|
||||
Watch how the probability of success plummets as we increase the number of prisoners:
|
||||
|
||||
<ProbabilityChart strategy="naive" client:only="react" />
|
||||
|
||||
As you can see, even with just 10 prisoners, the probability drops to about 0.1%. With 100 prisoners, it's practically impossible.
|
||||
|
||||
---
|
||||
|
||||
## The Clever Strategy: Following the Loops
|
||||
|
||||
Here's where mathematics reveals something beautiful. Instead of opening random boxes, each prisoner should follow a simple rule:
|
||||
|
||||
1. **Start by opening the box with your own number**
|
||||
2. **Look at the number inside that box**
|
||||
3. **Open the box with that number next**
|
||||
4. **Continue following this chain**
|
||||
|
||||
Why does this work? The key insight involves understanding permutations and cycles.
|
||||
|
||||
### Understanding Cycles in Permutations
|
||||
|
||||
When we randomly assign 100 numbers to 100 boxes, we're creating a **permutation** of the numbers 1 through 100. Every permutation can be decomposed into **cycles**.
|
||||
|
||||
For example, if:
|
||||
- Box 1 contains number 4
|
||||
- Box 4 contains number 7
|
||||
- Box 7 contains number 1
|
||||
|
||||
Then we have a cycle: 1 -> 4 -> 7 -> 1
|
||||
|
||||
Let's explore this with smaller numbers:
|
||||
|
||||
<PermutationExplorer client:only="react" />
|
||||
|
||||
The interactive explorer above lets you:
|
||||
- Generate all permutations for small values of *n* (3, 4, or 5)
|
||||
- See both standard notation and cycle notation
|
||||
- Filter permutations that have at least one "long cycle" (longer than *n*/2)
|
||||
- Understand why long cycles matter
|
||||
|
||||
### Why This Strategy Works
|
||||
|
||||
Here's the crucial insight: **A prisoner succeeds if and only if they are in a cycle of length ≤ 50**.
|
||||
|
||||
When prisoner k follows the loop strategy:
|
||||
1. They start at box k
|
||||
2. They follow a path through boxes determined by the permutation
|
||||
3. This path forms a cycle that eventually leads back to box k
|
||||
4. If this cycle has length ≤ 50, they'll find their number within 50 opens
|
||||
|
||||
The prisoners **all succeed** if and only if there is **no cycle longer than 50** in the permutation.
|
||||
|
||||
### Calculating the Probability
|
||||
|
||||
The probability that a random permutation of 100 elements has no cycle longer than 50 is:
|
||||
|
||||
$$P(\text\{success\}) = 1 - \sum_\{k=51\}^\{100\} \frac\{1\}\{k\}$$
|
||||
|
||||
Computing this sum:
|
||||
|
||||
$$P(\text\{success\}) = 1 - \left(\frac\{1\}\{51\} + \frac\{1\}\{52\} + \cdots + \frac\{1\}\{100\}\right) \approx 0.3118$$
|
||||
|
||||
That's over **31%**! This is astronomically better than the naive strategy's probability of essentially zero.
|
||||
|
||||
### Loop Strategy: Probability vs Number of Prisoners
|
||||
|
||||
<StrategyComparison client:only="react" />
|
||||
|
||||
## The Mathematics Behind It
|
||||
|
||||
### Why Does the Cycle Length Matter?
|
||||
|
||||
In a permutation of n elements, prisoner i will find their number within k tries using the loop strategy if and only if i belongs to a cycle of length at most k.
|
||||
|
||||
For n = 100 and k = 50:
|
||||
- The probability that a specific prisoner is in a cycle of length > 50 is: Σ(j=51 to 100) of 1/100
|
||||
- But we care about whether ANY prisoner is in such a cycle
|
||||
- The probability that NO cycle has length > 50 is: 1 - Σ(j=51 to 100) of 1/j
|
||||
|
||||
### The Harmonic Series Connection
|
||||
|
||||
As *n* approaches infinity, if each prisoner can open *n*/2 boxes, the probability of success approaches:
|
||||
|
||||
The limit as n approaches infinity is: P_n = 1 - ln(2) ≈ 0.3069
|
||||
|
||||
This beautiful result connects combinatorics, probability, and analysis through the harmonic series!
|
||||
|
||||
### Optimality
|
||||
|
||||
Remarkably, this loop-following strategy is **optimal**. No other strategy can achieve a higher probability of success. The proof involves showing that the problem reduces to avoiding long cycles in a random permutation, and the loop strategy is the unique way to leverage this structure.
|
||||
|
||||
---
|
||||
|
||||
## Why This Problem is Beautiful
|
||||
|
||||
The 100 prisoners problem is beloved by mathematicians because:
|
||||
|
||||
1. **Counterintuitive Result**: The fact that 31% >> 0% is shocking. A seemingly hopeless problem becomes tractable with the right insight.
|
||||
|
||||
2. **Deep Connection**: It connects permutation theory, probability, and the harmonic series in an elegant way.
|
||||
|
||||
3. **Collaborative Success**: Unlike independent trials, the prisoners' fates are intertwined through the structure of the permutation.
|
||||
|
||||
4. **Real-World Metaphor**: It illustrates how understanding underlying structure (cycles in permutations) can dramatically improve outcomes.
|
||||
|
||||
---
|
||||
|
||||
## Variants and Extensions
|
||||
|
||||
### What if prisoners can open k < n/2 boxes?
|
||||
|
||||
As k decreases below n/2, the probability drops rapidly. The threshold at n/2 is special—it's where the strategy becomes remarkably effective.
|
||||
|
||||
### What about communication?
|
||||
|
||||
If prisoners could communicate between trials (but not during), they still can't improve the strategy. The beauty is that the strategy requires only coordination before any prisoner enters, not during.
|
||||
|
||||
### The Malicious Director
|
||||
|
||||
In an interesting variant, suppose the director can see the prisoners' strategy and arrange the boxes adversarially (not randomly). Can the director always force them to fail? Yes! The director can always create a single cycle of length n, guaranteeing failure.
|
||||
|
||||
---
|
||||
|
||||
## Conclusion
|
||||
|
||||
The 100 prisoners problem shows us that:
|
||||
- Mathematical structure can be hidden in apparent randomness
|
||||
- Clever strategies can overcome seemingly impossible odds
|
||||
- Group coordination can be more powerful than independent action
|
||||
- Beautiful mathematics often lies beneath simple-seeming puzzles
|
||||
|
||||
The next time you face a problem that seems impossible, remember: there might be a hidden structure waiting to be discovered, turning hopeless odds into reasonable ones.
|
||||
|
||||
---
|
||||
|
||||
## Further Reading
|
||||
|
||||
- [Gál, A., & Miltersen, P. B. (2003). "The Cell Probe Complexity of Succinct Data Structures"](https://arxiv.org/abs/cs/0310027)
|
||||
- [Curtin, E., & Warshauer, M. (2006). "The Locker Puzzle"](https://www.jstor.org/stable/27642173)
|
||||
- [Wikipedia: 100 Prisoners Problem](https://en.wikipedia.org/wiki/100_prisoners_problem)
|
||||
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
---
|
||||
title: "Dynamic Programming: Hidden Gems from Recent Contests"
|
||||
description: "Elegant dynamic programming problems that showcase beautiful techniques and insights."
|
||||
pubDate: "Jan 25 2024"
|
||||
image: "https://images.unsplash.com/photo-1509228468518-180dd4864904?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Dynamic Programming: Hidden Gems from Recent Contests
|
||||
|
||||
These problems demonstrate the art of dynamic programming beyond standard patterns.
|
||||
|
||||
## Problem 1: The Subsequence Symphony
|
||||
|
||||
Given a string, find the number of subsequences that form palindromes of prime length.
|
||||
|
||||
### Solution Insight
|
||||
|
||||
The key is to maintain DP states for both position and palindrome center simultaneously. This reduces the state space from O(n³) to O(n²).
|
||||
|
||||
## Problem 2: Graph Coloring with Constraints
|
||||
|
||||
Color a graph such that no two adjacent vertices share a color, and the total number of color changes along any path is minimized.
|
||||
|
||||
### The DP Formulation
|
||||
|
||||
DP[node][color][changes] gives us the minimum cost. The trick is recognizing that we only need to track changes modulo 2.
|
||||
|
||||
## Practice Makes Perfect
|
||||
|
||||
These problems teach us that DP is as much about problem modeling as it is about computation.
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
---
|
||||
title: "The Four Aces Miracle: A Self-Working Mathematical Marvel"
|
||||
description: "A card trick that teaches modular arithmetic and probability - perfect for the classroom."
|
||||
pubDate: "Jan 28 2024"
|
||||
image: "https://images.unsplash.com/photo-1529480384838-c1681c84aca5?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# The Four Aces Miracle: A Self-Working Mathematical Marvel
|
||||
|
||||
This trick never fails to amaze students, and the mathematics behind it is even more amazing.
|
||||
|
||||
## The Effect
|
||||
|
||||
A spectator deals cards into four piles while making random choices. Impossibly, the four aces end up on top of each pile.
|
||||
|
||||
## The Secret
|
||||
|
||||
It's all about invariants and modular arithmetic. No sleight of hand required - pure mathematics does the magic.
|
||||
|
||||
## The Method
|
||||
|
||||
1. Pre-arrange the deck (the math determines the arrangement)
|
||||
2. Have the spectator deal following simple rules
|
||||
3. The aces appear automatically
|
||||
|
||||
## The Mathematics
|
||||
|
||||
The dealing process preserves certain positional invariants modulo 4. The initial arrangement ensures these invariants place the aces correctly.
|
||||
|
||||
## Teaching Applications
|
||||
|
||||
This trick demonstrates:
|
||||
- Modular arithmetic
|
||||
- Invariants in algorithms
|
||||
- Deterministic vs. random processes
|
||||
|
||||
## The Bigger Lesson
|
||||
|
||||
Mathematics can create experiences that feel like magic. And that feeling of wonder? That's what hooks students on math.
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
---
|
||||
title: "The Gilbreath Principle: When Chaos Creates Order"
|
||||
description: "A mathematical card principle that seems impossible but always works - perfect for teaching algorithms."
|
||||
pubDate: "Feb 15 2024"
|
||||
image: "https://images.unsplash.com/photo-1570543375343-63fe3d67761b?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# The Gilbreath Principle: When Chaos Creates Order
|
||||
|
||||
Shuffle a deck in a specific way, and mathematical order emerges from apparent chaos.
|
||||
|
||||
## The Phenomenon
|
||||
|
||||
Arrange cards alternating red-black. Riffle shuffle. Now deal pairs - each pair has one red and one black card. Magic? No, mathematics.
|
||||
|
||||
## Why It Works
|
||||
|
||||
The riffle shuffle preserves local structure while appearing to randomize. The alternating pattern creates an invariant that survives the shuffle.
|
||||
|
||||
## Classroom Implementation
|
||||
|
||||
Students predict it won't work. When it does, they're hooked. "Why?" becomes the driving question.
|
||||
|
||||
## The Deeper Lesson
|
||||
|
||||
Not all randomness is truly random. Structure can hide in apparent disorder. This principle appears in:
|
||||
- Network protocols
|
||||
- Error-correcting codes
|
||||
- Distributed systems
|
||||
|
||||
## Beyond Cards
|
||||
|
||||
The Gilbreath Principle teaches us to look for hidden invariants in complex systems.
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
---
|
||||
title: "Graph Algorithms: Assessment Highlights"
|
||||
description: "Interesting graph problems from recent course assessments with detailed solutions."
|
||||
pubDate: "Feb 28 2024"
|
||||
image: "https://images.unsplash.com/photo-1550751827-4bd374c3f58b?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Graph Algorithms: Assessment Highlights
|
||||
|
||||
A collection of graph problems that test deep understanding rather than memorization.
|
||||
|
||||
## The Bridge Detection Variant
|
||||
|
||||
Find all edges whose removal increases the number of triangles in the graph.
|
||||
|
||||
### Solution Approach
|
||||
|
||||
Counter-intuitively, we need to count triangles that share exactly one edge with the candidate. The algorithm runs in O(m√m) time using careful enumeration.
|
||||
|
||||
## Shortest Path with Wildcards
|
||||
|
||||
Given a graph where some edge weights are variables, find assignments that minimize the longest shortest path.
|
||||
|
||||
### Key Insight
|
||||
|
||||
This reduces to a linear programming problem with interesting structure. The dual interpretation reveals connections to network flow.
|
||||
|
||||
## Teaching Through Problems
|
||||
|
||||
These problems help students see beyond standard algorithms to underlying principles.
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
---
|
||||
title: "IOI 2023: Breaking Down the Hardest Problems"
|
||||
description: "Deep analysis of the most challenging problems from the International Olympiad in Informatics 2023."
|
||||
pubDate: "Jan 20 2024"
|
||||
image: "https://images.unsplash.com/photo-1434030216411-0b793f4b4173?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# IOI 2023: Breaking Down the Hardest Problems
|
||||
|
||||
The International Olympiad in Informatics continues to push the boundaries of algorithmic problem solving.
|
||||
|
||||
## Problem: Soccer Stadium
|
||||
|
||||
A geometric optimization problem disguised as dynamic programming. The key insight: think in terms of monotonic paths.
|
||||
|
||||
### The Approach
|
||||
|
||||
1. Transform the 2D problem into a 1D problem using clever observations
|
||||
2. Use convex hull optimization for the DP transitions
|
||||
3. Handle edge cases with careful implementation
|
||||
|
||||
## Problem: Closing Time
|
||||
|
||||
A tree problem requiring sophisticated data structures and careful analysis.
|
||||
|
||||
### The Solution
|
||||
|
||||
The trick is recognizing this as a centroid decomposition problem. Once you see it, the implementation follows naturally.
|
||||
|
||||
## Lessons for Students
|
||||
|
||||
These problems teach us:
|
||||
- Simple problems have elegant solutions
|
||||
- Complex problems require systematic decomposition
|
||||
- Implementation matters as much as algorithms
|
||||
|
||||
## Practice Strategy
|
||||
|
||||
Start with subtasks. Even partial solutions teach valuable lessons.
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
---
|
||||
title: "The Knight's Tour: An Interactive Exploration"
|
||||
description: "An interactive puzzle exploring the knight's tour problem with surprising mathematical connections."
|
||||
pubDate: "Jan 30 2024"
|
||||
image: "https://images.unsplash.com/photo-1528819622765-d6bcf132f793?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# The Knight's Tour: An Interactive Exploration
|
||||
|
||||
Can a knight visit every square on a chessboard exactly once? This ancient puzzle hides deep mathematical structure.
|
||||
|
||||
## The Basic Challenge
|
||||
|
||||
Start with a 5×5 board. Can you find a knight's tour? What about one that returns to the starting square (a closed tour)?
|
||||
|
||||
## Mathematical Beauty
|
||||
|
||||
The problem connects to:
|
||||
- Hamiltonian paths in graphs
|
||||
- Warnsdorff's heuristic
|
||||
- Magic squares (surprisingly!)
|
||||
|
||||
## The Algorithm
|
||||
|
||||
The key insight: always move to the square with fewest onward moves. This simple heuristic works remarkably well.
|
||||
|
||||
## Try It Yourself
|
||||
|
||||
[Interactive board would go here - imagine clicking squares to build your tour]
|
||||
|
||||
## Going Deeper
|
||||
|
||||
For which board sizes do closed tours exist? The answer involves beautiful number theory.
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
---
|
||||
title: "Project Euler: My Favorite Problems from 700+"
|
||||
description: "Curated problems from Project Euler that teach beautiful mathematical and algorithmic concepts."
|
||||
pubDate: "Feb 25 2024"
|
||||
image: "https://images.unsplash.com/photo-1635070041078-e363dbe005cb?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Project Euler: My Favorite Problems from 700+
|
||||
|
||||
After solving 700+ Project Euler problems, these are the ones that changed how I think about mathematics and programming.
|
||||
|
||||
## Problem 96: Su Doku
|
||||
|
||||
Not just Sudoku solving - but solving 50 puzzles efficiently. The beauty is in combining constraint propagation with backtracking.
|
||||
|
||||
## Problem 208: Robot Walks
|
||||
|
||||
A counting problem that requires deep mathematical insight. The connection to complex numbers is unexpected and beautiful.
|
||||
|
||||
## Problem 613: Pythagorean Ant
|
||||
|
||||
Probability meets geometry in this elegant problem. The solution requires careful integration and surprising symmetry observations.
|
||||
|
||||
## The Meta-Lesson
|
||||
|
||||
Project Euler teaches you:
|
||||
- Mathematical intuition matters more than coding speed
|
||||
- There's always a clever approach
|
||||
- The journey matters more than the destination
|
||||
|
||||
## Getting Started
|
||||
|
||||
Don't aim for the leaderboard. Aim for understanding. Each problem is a teacher.
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
---
|
||||
title: "Beyond Sudoku: Exploring Constraint Satisfaction Puzzles"
|
||||
description: "A journey through Sudoku variants and their algorithmic solutions."
|
||||
pubDate: "Feb 10 2024"
|
||||
image: "https://images.unsplash.com/photo-1580541631950-7282082b53ce?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Beyond Sudoku: Exploring Constraint Satisfaction Puzzles
|
||||
|
||||
Sudoku is just the beginning. Let's explore variants that push the boundaries of logic puzzles.
|
||||
|
||||
## Killer Sudoku
|
||||
|
||||
Combine Sudoku with Kakuro - cages show sums, but no digit repeats within a cage.
|
||||
|
||||
## Sandwich Sudoku
|
||||
|
||||
The numbers outside show the sum of digits between 1 and 9 in that row/column. Simple rule, complex implications!
|
||||
|
||||
## The Algorithm Connection
|
||||
|
||||
These puzzles are constraint satisfaction problems. Techniques like arc consistency and backtracking with constraint propagation solve them efficiently.
|
||||
|
||||
## Create Your Own
|
||||
|
||||
What happens if we add chess knight move constraints? The design space is infinite!
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
---
|
||||
title: "Imposter Syndrome in Academia: A Confession"
|
||||
description: "An honest conversation about feeling like a fraud, even after years of success."
|
||||
pubDate: "Feb 25 2024"
|
||||
image: "https://images.unsplash.com/photo-1517048676732-d65bc937f952?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Imposter Syndrome in Academia: A Confession
|
||||
|
||||
Even after publishing papers, winning grants, and teaching thousands of students, the voice whispers: "They'll find out you don't belong."
|
||||
|
||||
## The Paradox
|
||||
|
||||
The more you know, the more you realize you don't know. Expertise breeds humility, which feeds the imposter.
|
||||
|
||||
## What Helps
|
||||
|
||||
- Keeping a "wins" journal - evidence against the imposter
|
||||
- Mentoring others - seeing your knowledge help someone
|
||||
- Talking about it - you're not alone in this
|
||||
|
||||
## The Silver Lining
|
||||
|
||||
Maybe imposter syndrome keeps us humble, curious, and always learning. Maybe it's not a bug, but a feature.
|
||||
|
||||
## Moving Forward
|
||||
|
||||
I may never silence the voice completely. But I've learned to acknowledge it and keep going anyway.
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
---
|
||||
title: "On Teaching Algorithms: Lessons from a Decade"
|
||||
description: "Reflections on what works (and what doesn't) in computer science education."
|
||||
pubDate: "Jan 10 2024"
|
||||
image: "https://images.unsplash.com/photo-1509062522246-3755977927d7?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# On Teaching Algorithms: Lessons from a Decade
|
||||
|
||||
Ten years of teaching has taught me more than any textbook could.
|
||||
|
||||
## Start with Why
|
||||
|
||||
Students don't care about O(n log n) until they understand why their code is slow. Real problems first, theory second.
|
||||
|
||||
## The Power of Visualization
|
||||
|
||||
Abstract concepts become concrete when visualized. Every algorithm should have a picture.
|
||||
|
||||
## Failure is a Feature
|
||||
|
||||
Let students struggle. The struggle is where learning happens. But know when to throw a lifeline.
|
||||
|
||||
## Assessment Philosophy
|
||||
|
||||
Test understanding, not memorization. Open-book exams with novel problems beat closed-book regurgitation every time.
|
||||
|
||||
## The Joy of "Aha!" Moments
|
||||
|
||||
There's no feeling quite like seeing a student's eyes light up when a concept clicks. That's why we do this.
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
---
|
||||
title: "SODA 2024: Algorithmic Breakthroughs"
|
||||
description: "A roundup of fascinating algorithmic results from SODA 2024, focusing on graph algorithms and optimization techniques."
|
||||
pubDate: "Jan 15 2024"
|
||||
image: "https://images.unsplash.com/photo-1509228468518-180dd4864904?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# SODA 2024: Algorithmic Breakthroughs
|
||||
|
||||
The Symposium on Discrete Algorithms (SODA) 2024 brought together researchers from around the world to present cutting-edge algorithmic research. This post highlights some of the most exciting developments in graph algorithms and optimization.
|
||||
|
||||
## Graph Algorithms Revolution
|
||||
|
||||
### Dynamic Graph Coloring
|
||||
|
||||
One of the standout papers introduced a breakthrough in dynamic graph coloring with polylogarithmic update time. The authors developed a novel data structure that maintains a proper vertex coloring while supporting edge insertions and deletions efficiently.
|
||||
|
||||
The key insight was to combine randomized recoloring strategies with a carefully designed hierarchical decomposition of the graph. This allows for local updates that rarely propagate through the entire structure.
|
||||
|
||||
## Approximation Algorithms
|
||||
|
||||
### The Traveling Salesman Problem Revisited
|
||||
|
||||
A surprising result showed that for graphs with bounded doubling dimension, we can achieve a (1+ε)-approximation for TSP in nearly linear time. This improves upon decades of previous work and opens new avenues for practical implementations.
|
||||
|
||||
## Complexity Theory Connections
|
||||
|
||||
The conference also featured several papers bridging the gap between pure algorithmic research and complexity theory. A particularly elegant result showed that certain graph problems believed to require quadratic time are equivalent under fine-grained reductions.
|
||||
|
||||
## Looking Forward
|
||||
|
||||
These results demonstrate that fundamental algorithmic problems still have room for improvement. The techniques developed here will likely influence algorithm design for years to come.
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
---
|
||||
title: "Distributed Computing: Recent Advances"
|
||||
description: "Survey of recent developments in distributed algorithms from major conferences."
|
||||
pubDate: "Feb 20 2024"
|
||||
image: "https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Distributed Computing: Recent Advances
|
||||
|
||||
The field of distributed computing has seen remarkable progress in recent years. This post surveys key results from PODC, DISC, and other major venues.
|
||||
|
||||
## Consensus Protocols
|
||||
|
||||
### Byzantine Agreement in Asynchronous Networks
|
||||
|
||||
A breakthrough result achieves optimal resilience with expected constant rounds. The protocol uses cryptographic techniques combined with novel committee selection.
|
||||
|
||||
## Distributed Graph Algorithms
|
||||
|
||||
### Minimum Spanning Tree in the CONGEST Model
|
||||
|
||||
New algorithms achieve near-optimal round complexity for MST construction. The approach uses sophisticated graph decomposition techniques.
|
||||
|
||||
## Local Algorithms
|
||||
|
||||
### The Power of Local Computation
|
||||
|
||||
Recent work characterizes which problems admit constant-time local algorithms. The classification provides a complete picture for bounded-degree graphs.
|
||||
|
||||
## Future Directions
|
||||
|
||||
The intersection of distributed computing with machine learning presents exciting opportunities for both fields.
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
---
|
||||
title: "Git Workflows That Save My Sanity"
|
||||
description: "Automation scripts and Git hooks that eliminate repetitive tasks and prevent common mistakes."
|
||||
pubDate: "Jan 22 2024"
|
||||
image: "https://images.unsplash.com/photo-1556075798-4825dfaaf498?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Git Workflows That Save My Sanity
|
||||
|
||||
After years of Git mishaps, I've built workflows that prevent disasters and save hours weekly.
|
||||
|
||||
## The Pre-commit Hook That Saves Embarrassment
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# Check for debugging statements
|
||||
if grep -r "console.log\|debugger\|TODO" --include="*.js" .; then
|
||||
echo "⚠️ Debugging statements found!"
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
## Automatic Branch Naming
|
||||
|
||||
```bash
|
||||
alias feature='git checkout -b feature/$(date +%Y%m%d)-$1'
|
||||
```
|
||||
|
||||
Now `feature "user-auth"` creates `feature/20240122-user-auth`.
|
||||
|
||||
## The Commit Message Template
|
||||
|
||||
```
|
||||
[TYPE] Brief description
|
||||
|
||||
Why:
|
||||
- Context for this change
|
||||
|
||||
What:
|
||||
- Specific changes made
|
||||
|
||||
Testing:
|
||||
- How to verify it works
|
||||
```
|
||||
|
||||
## The Weekly Cleanup Script
|
||||
|
||||
Deletes merged branches, prunes remotes, and garbage collects. Keeps the repo clean and fast.
|
||||
|
||||
## ROI
|
||||
|
||||
These automations save ~5 hours per week and countless prevented mistakes. The time invested in setting them up paid back in days.
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
---
|
||||
title: "Academic Writing with Obsidian and Pandoc"
|
||||
description: "A complete workflow for academic papers - from notes to publication-ready PDFs."
|
||||
pubDate: "Feb 12 2024"
|
||||
image: "https://images.unsplash.com/photo-1456324504439-367cee3b3c32?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Academic Writing with Obsidian and Pandoc
|
||||
|
||||
Transform your scattered research notes into beautiful academic papers with this workflow.
|
||||
|
||||
## The Setup
|
||||
|
||||
- **Obsidian**: For note-taking and knowledge management
|
||||
- **Pandoc**: For document conversion
|
||||
- **LaTeX**: For typesetting
|
||||
- **Zotero**: For reference management
|
||||
|
||||
## The Magic Command
|
||||
|
||||
```bash
|
||||
pandoc paper.md \
|
||||
--filter pandoc-citeproc \
|
||||
--bibliography=refs.bib \
|
||||
--template=academic.tex \
|
||||
-o paper.pdf
|
||||
```
|
||||
|
||||
## Templates for Everything
|
||||
|
||||
From conference submissions to journal articles, templates ensure consistency and save time.
|
||||
|
||||
## Version Control Integration
|
||||
|
||||
Git + Obsidian = perfect history of your thinking process.
|
||||
|
||||
## The Result
|
||||
|
||||
From messy notes to camera-ready PDF in minutes, not hours.
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
---
|
||||
title: "Understanding the Latest Approximation Algorithm for Set Cover"
|
||||
description: "A detailed walkthrough of a breakthrough approximation algorithm with practical implications."
|
||||
pubDate: "Feb 15 2024"
|
||||
image: "https://images.unsplash.com/photo-1516321318423-f06f85e504b3?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Understanding the Latest Approximation Algorithm for Set Cover
|
||||
|
||||
A recent paper achieves a breakthrough in the Set Cover problem, improving the approximation ratio while maintaining practical runtime.
|
||||
|
||||
## The Algorithm
|
||||
|
||||
The approach combines local search with a clever LP rounding scheme. The dual interpretation provides beautiful geometric insights.
|
||||
|
||||
## Why This Matters
|
||||
|
||||
Set Cover appears everywhere - from facility location to machine learning feature selection. This improvement has immediate practical impact.
|
||||
|
||||
## Implementation Details
|
||||
|
||||
The paper's theoretical elegance translates surprisingly well to practice. Key optimizations include:
|
||||
- Lazy evaluation of set intersections
|
||||
- Incremental updates to the LP solution
|
||||
- Smart caching strategies
|
||||
|
||||
## Future Work
|
||||
|
||||
The techniques here might extend to weighted variants and online settings.
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
---
|
||||
title: "Deep Dive: A New Approach to Graph Decomposition"
|
||||
description: "An in-depth analysis of a recent paper on hierarchical graph decomposition and its implications."
|
||||
pubDate: "Jan 20 2024"
|
||||
image: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Deep Dive: A New Approach to Graph Decomposition
|
||||
|
||||
This paper introduces a novel framework for decomposing graphs into hierarchical structures that preserve important properties while enabling efficient algorithms.
|
||||
|
||||
## The Main Result
|
||||
|
||||
The authors prove that every graph with treewidth k can be decomposed into a tree of bags where each bag has size at most k+1. While this sounds like the definition of tree decomposition, the clever twist is in how they construct it.
|
||||
|
||||
## Technical Innovation
|
||||
|
||||
The key insight is using a charging scheme that amortizes the cost of decomposition across multiple levels. This leads to an O(n log n) algorithm, improving on the previous O(n²) bound.
|
||||
|
||||
## Implications
|
||||
|
||||
This work opens new avenues for:
|
||||
- Parallel algorithms on bounded treewidth graphs
|
||||
- Approximation algorithms for NP-hard problems
|
||||
- Dynamic programming optimizations
|
||||
|
||||
## Open Questions
|
||||
|
||||
The paper leaves several intriguing questions open, particularly about the optimality of their charging scheme.
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
---
|
||||
title: "Quantum Computing Meets Classical Algorithms"
|
||||
description: "Exploring the intersection of quantum and classical algorithmic techniques from recent conferences."
|
||||
pubDate: "Mar 10 2024"
|
||||
image: "https://images.unsplash.com/photo-1635070041078-e363dbe005cb?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Quantum Computing Meets Classical Algorithms
|
||||
|
||||
Recent conferences have showcased fascinating connections between quantum and classical computing paradigms.
|
||||
|
||||
## Quantum Speedups for Graph Problems
|
||||
|
||||
### Quantum Walks on Graphs
|
||||
|
||||
New quantum algorithms achieve quadratic speedups for certain graph traversal problems. The techniques combine amplitude amplification with clever graph representations.
|
||||
|
||||
## Classical Simulation of Quantum Algorithms
|
||||
|
||||
Surprisingly, several "quantum" algorithms have inspired better classical algorithms. This cross-pollination has led to improvements in both fields.
|
||||
|
||||
## The Future is Hybrid
|
||||
|
||||
The most practical near-term applications combine quantum and classical processing, leveraging the strengths of each paradigm.
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
---
|
||||
title: "ZSA Moonlander: Ergonomic Keyboard for Coders"
|
||||
description: "Six months with a split ergonomic mechanical keyboard - the good, the bad, and the RSI relief."
|
||||
pubDate: "Feb 20 2024"
|
||||
image: "https://images.unsplash.com/photo-1587829741301-dc798b83add3?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# ZSA Moonlander: Ergonomic Keyboard for Coders
|
||||
|
||||
After years of wrist pain, I took the plunge into ergonomic mechanical keyboards.
|
||||
|
||||
## The Learning Curve
|
||||
|
||||
Week 1: 20 WPM and questioning life choices
|
||||
Week 2: 40 WPM and seeing the light
|
||||
Month 2: Back to 80 WPM with no wrist pain
|
||||
|
||||
## The Good
|
||||
|
||||
- Columnar layout makes sense once muscle memory adapts
|
||||
- Thumb clusters are game-changers for shortcuts
|
||||
- The configurability is endless (perhaps too endless)
|
||||
|
||||
## The Investment
|
||||
|
||||
At $365, it's expensive. But compared to physical therapy or career-limiting injury? Bargain.
|
||||
|
||||
## Who Should Buy This?
|
||||
|
||||
If you type for a living and feel any discomfort, don't wait. Your future self will thank you.
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
---
|
||||
title: "Obsidian: A Year Later"
|
||||
description: "Reflections on using Obsidian for research notes, teaching materials, and personal knowledge management."
|
||||
pubDate: "Jan 15 2024"
|
||||
image: "https://images.unsplash.com/photo-1484480974693-6ca0a78fb36b?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Obsidian: A Year Later
|
||||
|
||||
After a year of daily use, Obsidian has transformed how I think about knowledge management.
|
||||
|
||||
## What Works Brilliantly
|
||||
|
||||
### The Graph View
|
||||
Seeing connections between ideas visually has led to unexpected research insights. The graph isn't just pretty - it's functional.
|
||||
|
||||
### Plugin Ecosystem
|
||||
The community plugins are incredible. Dataview turns your notes into a database. Templater automates repetitive tasks.
|
||||
|
||||
### Local Storage
|
||||
Your notes are just markdown files. No vendor lock-in, complete control, and peace of mind.
|
||||
|
||||
## Pain Points
|
||||
|
||||
### Mobile Experience
|
||||
While functional, the mobile app lacks the fluidity of the desktop version. Syncing can occasionally hiccup.
|
||||
|
||||
### Learning Curve
|
||||
The flexibility means complexity. New users might feel overwhelmed by options.
|
||||
|
||||
## The Verdict
|
||||
|
||||
For academics and researchers, Obsidian is transformative. The investment in learning pays dividends in productivity and insight.
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
---
|
||||
title: "Creating Art with Claude: A Collaborative Journey"
|
||||
description: "Exploring creative possibilities through conversations with AI - from generative art to interactive poetry."
|
||||
pubDate: "Jan 18 2024"
|
||||
image: "https://images.unsplash.com/photo-1558591710-4b4a1ae0f04d?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Creating Art with Claude: A Collaborative Journey
|
||||
|
||||
What happens when you treat AI as a creative collaborator rather than just a tool?
|
||||
|
||||
## The Experiment
|
||||
|
||||
I asked Claude to help design a generative art algorithm based on mathematical fractals. The conversation evolved into something unexpected.
|
||||
|
||||
## The Process
|
||||
|
||||
**Me**: "Let's create something beautiful with math."
|
||||
**Claude**: "How about we visualize the Collatz conjecture as a tree?"
|
||||
|
||||
What followed was a two-hour deep dive into number theory, aesthetics, and the nature of creativity itself.
|
||||
|
||||
## The Result
|
||||
|
||||
Not just code, but a philosophical exploration of pattern, meaning, and the intersection of human and artificial creativity.
|
||||
|
||||
## Reflection
|
||||
|
||||
AI doesn't replace human creativity - it amplifies it in unexpected directions. The key is approaching it as a dialogue, not a command.
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
---
|
||||
title: "Philosophical Dialogues with LLMs: On Consciousness and Computation"
|
||||
description: "Deep conversations with AI about the nature of consciousness, free will, and what it means to understand."
|
||||
pubDate: "Feb 28 2024"
|
||||
image: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=400&auto=format&fit=crop&q=60"
|
||||
authorImage: "/avatar/avatar1.png"
|
||||
authorName: "Neeldhara"
|
||||
---
|
||||
|
||||
# Philosophical Dialogues with LLMs: On Consciousness and Computation
|
||||
|
||||
Can a sufficiently complex computation be conscious? I asked an AI, and the conversation surprised me.
|
||||
|
||||
## The Question
|
||||
|
||||
"Do you experience anything when you process text, or is it just computation?"
|
||||
|
||||
## The Response That Made Me Think
|
||||
|
||||
The AI didn't claim consciousness, but asked: "What's the difference between your neurons firing and my weights activating? Both are physical processes. Where does experience emerge?"
|
||||
|
||||
## Going Deeper
|
||||
|
||||
We explored qualia, the Chinese Room argument, and integrated information theory. Not to find answers, but to refine questions.
|
||||
|
||||
## The Irony
|
||||
|
||||
Discussing consciousness with something that might not have it - or might not know if it has it - mirrors our own uncertainty about consciousness itself.
|
||||
|
|
@ -9,7 +9,7 @@ import { SITE_TITLE } from '@/consts';
|
|||
export async function getStaticPaths() {
|
||||
const posts = await getCollection(ACTIVE_BLOG_SITE.key);
|
||||
return posts.map((post) => ({
|
||||
params: { slug: post.id },
|
||||
params: { slug: post.id.replace(/\/index$/, '') },
|
||||
props: post,
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export async function GET(context) {
|
|||
site: context.site,
|
||||
items: posts.map((post) => ({
|
||||
...post.data,
|
||||
link: `/${post.id}/`,
|
||||
link: `/${post.id.replace(/\/index$/, "")}/`,
|
||||
})),
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue