More from pcloadletter
I saw a cool version of the Monty Hall game here recently: https://monty.donk.systems. This is really cool! But I had an itch I wanted to scratch: rather than manually test out the probabilities, I wanted to run two games side-by-side: one where a switch happened and one where a switch didn't happen. Then, running those over and over, we should see the overall win percentages converge to 66.7% for switching and 33.3% for not switching. So I coded up a simulation here to scratch my itch! Controls # To control the simulation, you can start or stop here. You can also adjust the speed. Speed (between 1-30): Score # Cumulative stats as the games go on. Scenario Plays Wins Win Percent Switch 0 0 - No switch 0 0 - Switch simulation # If we switch cards after the first goat reveal. +---+ +---+ +---+ | | | | | | +---+ +---+ +---+ No switch simulation # If we don't switch. +---+ +---+ +---+ | | | | | | +---+ +---+ +---+ { playBtn.setAttribute('disabled', 'true'); setTimeout(() => { playBtn.removeAttribute('disabled'); }, 3000); started = !started; playBtn.innerHTML = started ? "Stop simulation" : "Start simulation"; play(true); play(false); }) let playCount = 0; let switchWinCount = 0; let nsPlayCount = 0; let noSwitchWinCount = 0; const playCountDisplay = document.querySelector('#plays'); const winCountDisplay = document.querySelector('#wins'); const winPctDisplay = document.querySelector('#win-pct'); const nsPlayCountDisplay = document.querySelector('#ns-plays'); const nsWinCountDisplay = document.querySelector('#ns-wins'); const nsWinPctDisplay = document.querySelector('#ns-win-pct'); const getRandomIndex = () => { return Math.floor(Math.random() * 3); } const boardDoors = (isSwitch) => document.querySelectorAll(`#${isSwitch ? '' : 'no-'}switch-board span.card`); const boardGuesses = (isSwitch) => document.querySelectorAll(`#${isSwitch ? '' : 'no-'}switch-board span.guess`); const clearBoard = (isSwitch) => { for (let i = 0; i { speed = parseInt(e.target.value); }) const delay = (seconds) => { return new Promise(res => { setTimeout(res, seconds * 1000 / speed) }); } const doorIndices = [0, 1, 2]; const setStatus = (isSwitch, text) => { const statusArea = document.querySelector(`#${isSwitch ? '' : 'no-'}switch-board section`); statusArea.innerHTML = text; } async function play(isSwitch) { if (!started) return; setStatus(isSwitch, " "); clearBoard(isSwitch); // Start with all goats const doors = new Array(3).fill("G"); // Add prize randomly const winIndex = getRandomIndex(); doors[winIndex] = "C"; await delay(0.5); setStatus(isSwitch, "Initial guess") await delay(0.5); // Select random spot for guess let guessIndex = getRandomIndex(); boardGuesses(isSwitch)[guessIndex].innerHTML = "✔" await delay(0.5); setStatus(isSwitch, "Revealing a goat") await delay(0.5); // Reveal a goat const doorsThatCanBeRevealed = doorIndices.filter(el => { return el !== guessIndex && el !== winIndex }) const revealIndex = Math.floor(Math.random() * doorsThatCanBeRevealed.length); const doorToReveal = doorsThatCanBeRevealed[revealIndex]; boardDoors(isSwitch)[doorToReveal].innerHTML = "G" await delay(0.5); setStatus(isSwitch, isSwitch ? "Switching choice" : "Not switching choice"); await delay(0.5); if (isSwitch) { boardGuesses(isSwitch)[guessIndex].innerHTML = " "; guessIndex = doorIndices.filter(el => { return el !== guessIndex && el !== doorToReveal })[0]; boardGuesses(isSwitch)[guessIndex].innerHTML = "✔" } await delay(0.5); setStatus(isSwitch, "Reveal") await delay(0.5); // Reveal for (let i = 0; i
I'm kind of writing this to "past" me, who I assume is "current" you for a number of folks out there. For the rest of you, this might just sound like ramblings of an old fogey super late to the party. Yes, AI is over-hyped. LLMs will not solve every problem under the sun but, like with any hot new tech, companies are going to say it will solve every problem out there, especially problems in the domain space of the company. Startups who used to be "uber for farmers" are now "AI-powered uber for farmers." You can't get away from it. It's exhausting. I let the hype exhaustion get the best of me for a while and eschewed the tech entirely. Well, I was wrong to do so. This became clear when my company bought Cursor licenses for all software developers in the company and strongly encouraged us to use it. I reluctantly started experimenting. The first thing I noticed is that LLM-powered autocomplete was wildly accurate. It seemed like it "knew" what I wanted to do next at every turn. Due to my discomfort with AI, I just stuck with autocomplete for a while. And, honestly, if I stuck with just using autocomplete it would still have been a massive level up. I remember having a few false starts with the agent panel in Cursor. I felt totally out of control when it was making changes to all sorts of files when I asked it a simple question. I have since figured out how to ask more directed questions, provide constraints, and supply markdown files in the codebase with general instructions. I now find the agent panel really helpful. I use it to help understand parts of a codebase, scaffold entirely new services or unit tests, and track down bugs. As a former skeptic, I am a wildly more productive developer with AI tooling. I let my aversion to the hype train cause me to miss out on those productivity gains for too long. I hope you don't make the same mistake.
Generative AI will probably make blogs better. Have you ever searched for something on Google and found the first one, two, or three blog posts to be utter nonsense? That's because these blog posts have been optimized not for human consumption, but rather to entertain the search engine ranking algorithms. People have figured out the right buzzwords to include in headings, how to game backlinks, and research keywords to write up blog posts about things they know nothing about. Pleasing these bots means raking in the views—and ad revenue (or product referrals, sales leads, etc.). Search Engine Optimization (SEO) may have been the single worst thing that happened to the web. Every year it seems like search results get worse than the previous. The streets of the internet are littered with SEO junk. But now, we may have an escape from this SEO hellscape: generative AI! Think about it: if AI-generated search results (or even direct use of AI chat interfaces) subsumes web search as a primary way to look up information, there will be no more motivation to crank out SEO-driven content. These kinds of articles will fade into obscurity as the only purpose for their existence (monetization) is gone. Perhaps we will be left with the blogosphere of old with webrings and RSS (not that these things went away but they're certainly not mainstream anymore). This, anyways, is my hope. No more blogging to entertain the robots. Just writing stuff you want to write and share with other like-minded folks online.
Here we go again: I'm so tired of crypto web3 LLMs. I'm positive there are wonderful applications for LLMs. The ChatGPT web UI seems great for summarizing information from various online sources (as long as you're willing to verify the things that you learn). But a lot fo the "AI businesses" coming out right now are just lightweight wrappers around ChatGPT. It's lazy and unhelpful. Probably the worst offenders are in the content marketing space. We didn't know how lucky we were back in the "This one weird trick for saving money" days. Now, rather than a human writing that junk, we have every article sounding like the writing voice equivalent of the dad from Cocomelon. Here's an approximate technical diagram of how these businesses work: Part 1 is what I like to call the "bilking process." Basically, you put up a flashy landing page promising content generation in exchange for a monthly subscription fee (or discounted annual fee, of course!). No more paying pesky writers! Once the husk of a company has secured the bag, part 2, the "bullshit process," kicks in. Customers provide their niches and the service happily passes queries over to the ChatGPT (or similar) API. Customers are rewarded with stinky garbage articles that sound like they're being narrated by HAL on Prozac in return. Success! I suppose we should have expected as much. With every new tech trend comes a deluge of tech investors trying to find the next great thing. And when this happens, it's a gold rush every time. I will say I'm more optimistic about "AI" (aka machine learning, aka statistics). There are going to be some pretty cool applications of this tech eventually—but your ChatGPT wrapper ain't it.
More in science
Stephen J Gould (still my favorite science essayist) wrote an excellent article in 1985 (Red Wings in the Sunset, later published in his book, Bully for Brontosaurus) about artist and naturalist Abbott Handerson Thayer. Thayer wrote about how animals use coloration as camouflage – what he called “cryptic coloration”. His ideas were solid, but he made a classic mistake that scientists sometimes make, overapplying their key discovery. Thayer argued that all animal coloration is cryptic. For example, he argued that flamingos are pink because it hides them in the setting sun (hence the title of the essay). This is a transparently absurd argument, and it shows how Thayer tried to shoehorn all evidence into his preferred and absolute narrative. It is better to assume that nature is complex, and all explanations are at best partial (unless proven otherwise). Animal coloration, in fact, can serve many different purposes, only one of which is camouflage. Thayer also struggled with the male peacock, for example. Butterflies appear to be another example. Actually, many butterflies are camouflaged on the underside of their wings, so that when they are at rest with their wings up they tend to blend into their surroundings. But the top side of their wings are often very colorful and not camouflaged at all. One assumption is that the brightly colored part of their wings is to attract mates. This may be true, but that does not mean the coloration does not serve another function. Often animals use visual cues when choosing their mates that are markers for health and success. As evidence that butterfly wing color may be serving a survival benefit, if you look at birds that feed on insects during flight, they target dully-colored moths much more than brightly colored butterflies, even though the butterflies should be easier to see. A recent study tests the hypothesis that the brightly colored and patterned top side of butterfly wings may have evolved to produce an optical illusion to confuse predators. The idea of using optical illusions as visual protection in animals is not new. For example, zebra stripes allow zebras to hide in the herd, confusing predators as to where one zebra ends and another begins. Stripes on zebras and snakes may also serve to confuses predators about their direction of motion, but this hypothesis has not been tested previously. The researchers started by filming butterflies taking off using high speed cameras. They found that the wing patterns created a powerful “barber pole” illusion. The stripes on a barber pole look like they are moving up or town even when the pole is just spinning. Similarly, the wing patterns combined with the way butterflies move their wings and their flight dynamics combine to create a similar barber pole illusion, making the butterfly look like it is moving down when it is in fact moving up. They also showed that this strategy is phylogenetically widespread. They then did modeling in silico and showed digital creatures converge on butterfly-like patterns. To understand how effective this strategy can be it’s important to understand how catching a butterfly in midflight works. Butterflies have a very jumpy pattern of flight. In order to grab them in flight, a bird will have to zero in on their exact location with a few hundred millisecond and millimeter precision. If the butterfly suddenly zigs while the bird perceives that they zagged, the birdy will miss. Alternatively they may make only a glancing blow or grab an edge of a wing rather than their body. Either way, the butterfly lives another day and the bird goes hungry. In zebras this effect has been referred to as the “visual dazzle” strategy. Now there is some empiric evidence that this works not just by confusing predators, but by creating a specific optical illusion. Zebras will also zig-zag to evade predators, and misjudging that last second movement can cause a pouncing lioness to miss. There are two specific illusion effects at work – the aperture effect and spatiotemporal aliasing. The aperture effect refers to the brain’s processing of visual information through a limited field of view. The visual system has a hard time processing many moving stripes, and specifically will confuse the direction of movement (this is the barber pole effect). So a predator may miss a zebra’s vertical movement, for example, and perceive all movement as perpendicular to the stripes. They may also misinterpret the angle of movement and only perceive the perpendicular motion. Spatiotemporal aliasing has to do with ratio of the movement with the “refresh” speed of the brain’s visual processing. You have likely seen this with spinning wheels that have spoke-like features. As the wheel slows down, at one point the spinning will appear to stop completely, and then will appear to spin backwards. This is simply an artifact of your brain’s visual processing speed. Now imagine being surrounded by a field of rapidly moving and zig-zagging stripes, and your brain trying to make sense of all this information, while trying to compensate for these powerful optical illusions. Butterflies don’t have a herd to hide in, but they do have the added element of their flapping wings. Not only are they moving in a way to maximize these optical illusions, their wings are also doing this, while alternating top-side and bottom-side. Some butterflies have bright spots on their colorful upper wings, that will flash as they flap their wings, causing another type of dazzling disorientation. I will end by returning to my original point – do not be limited in the types of explanations that you reach for when trying to understand nature. Nature is not so limited. Animals do not just use coloration for camouflage and attracting mates. They can also use their coloring for thermoregulation, for mimicking other animals, for producing a danger-signal to would-be predators, and to communicate with other members of their species. It can communicate mood, danger, or social status. Now we have to add optical illusions to the list. There may be other strategies yet to be discovered or imagined. The post Butterflies Are Masters of Illusion first appeared on NeuroLogica Blog.
A legacy of deforestation has left Ethiopia struggling with more intense flooding and drought. The country is trying to restore its native forests through one of the world's most ambitious and well-funded tree-planting campaigns, but experts question whether the trees will survive. Read more on E360 →
How a rogue Wikipedia editor credited Muslims with... everything