The Horsey Cup

Posted on Wed, Dec 27 2023 in Bob's Journal

My mother was a proponent of natural remedies. What this meant in practice was that I spent a significant portion of my childhood inside cramped stores that smelled vaguely earthy and had bottles of every imaginable herb in capsule or syrup form. The great thing about herbal remedies is that you should consume lots of them every day, no matter the situation. I remember when my mother found out about the wonders of bee pollen, and for months we ate tiny spoonfuls of small orangish-yellow spheres.

Of course, if herbs were good when you were healthy, they were even more important when you were sick. My mother had a simple set of responses to any illness that entered the house. For a runny nose or other minor ailment, Vitamin C was the solution. For more advanced illnesses, it was time to break out the echinacea, but if that didn't work, there was still one herb of last resort: blue vervain. Of course, I don't know if I ever actually saw the label, so it sounded like "bluverbane" to younger me.

It came as a syrup, and by my mother's scale there could be nothing more effective. If you've never had the experience, imagine the most bitter thing you've ever put in your mouth, that burns slightly and leaves a bittersweet aftertaste that's impossible to scrape off your tongue. I tried my best to be an obedient son, but even I had a hard time obeying when asked to drink a tablespoon, no matter how much she insisted it was just what my body needed to heal.

My mother, being the cunning innovator that she was, hit upon a solution. She would dissolve the blue vervain in a mug of hot tea. It was a brilliant answer, with only a few small problems. First, none of her sons liked hot tea. Secondly, the blue vervain easily overpowered whatever weak flavor the tea had. Still, I remember many winter days sitting staring at a mug of suspicious smelling hot tea.

One of those days, my grandmother had come to visit, and hit upon a new strategy. She coaxed me to take a sip of the blue vervain tea, until finally I raised it to my mouth and took the tiniest sip. "Wow, did you see that?" she exclaimed.

I hadn't seen anything.

At this point, I need to make a small diversion, the reason for which will soon become apparent. Aside from a very impressive collection of herbal supplements, my mother was also the proud owner of a diverse set of ceramic mugs. There were plain ones, ones with patterns, ones with pictures, in various sizes. The one I was using was a white mug with a picture of a red and orange sunset on the side. In front of that stormy sunset proudly stood a lone brown stallion with a black tail and mane.

"What!?" I asked my grandmother, wondering what she had seen.

"That horse flicked its tail," she informed me.

That seemed unusual to me, but there are many unusual things in this world. I watched the horse closely, but it had apparently chosen to stop after that brief movement.

My grandmother suggested an experiment: "Why don't you take another sip of your tea, and watch the horse closely?"

I tried this, but it turns out that it's impossible to drink a nearly full mug of hot tea while keeping a close eye on the outside of it, particularly since I was still young enough to hold it with both hands instead of by the handle.

"Wow, that horse kicked his leg!" my grandmother exclaimed.

From that time forward, blue vervain was always served in the "Horsey" cup. With each sip, the poor patient strained vainly to watch the horse and someone else stood by to declare that it had, in fact, moved.


Sight Unseen

Posted on Thu, Apr 13 2023 in Bob's Journal

Imagine that you want to buy a house. Given the real estate market, it might be hard to imagine, but try anyhow and let's see what happens.

One day, you're called up by your perky real estate agent. "Have I got the house for you!" she exclaims as soon as you pick up the phone. "It's absolutely perfect. You're just going to love it. When can you come down and sign the contract?"

You're glad to hear something has come available. You've been searching for months. "I'd love to take a look at it," you tell her. "I have tomorrow afternoon open, if you can give me a tour then."

She seems a bit surprised at your suggestion. "I can't give you a tour of the house yet, but trust me, you're going to love it."

"Okay," you say, trying to be reasonable. "If you give me the address, I'll drive by it and take a look at the exterior and the neighborhood."

"That's not how this works," she says sternly. "But I can send you written descriptions of it, and even some paintings people have done. Trust me, it's the most amazing house you can imagine. When you see this, you're going to realize how important it is to take this offer while it's available."

"Alright," you say. "Send that over. Can you at least tell me the general area it's in?"

"It's right near your work, your gym, the stadium, and your brother's house."

"How can that be?" you ask. "My brother's house is nearly two hours from the stadium."

"I'll bring the packet over tomorrow," she responds brightly. "You'll see. It's amazing."

As promised, she arrives, beaming, at your door the following afternoon. She shoves a massive folder, stuffed to bursting with papers, into your arms. "Take a look at that!" she announces.

You start flipping through the pages. There are a lot of descriptions. One picture shows a big farmhouse, sitting in the midst of a lush green field. An account describes the luxurious swimming pool in the backyard. Another mentions having daily tea in the rose garden, and another how it's within easy walking distance of a favorite club. You can't help but notice that it's hard to make all of these accounts fit together cleanly, but the house sounds amazing.

Your agent watches you intently, and asks "So what did you think?" as soon as you flip past the final sheet of paper.

"It sounds nice, I guess," you respond. "Are you sure these are all talking about the same house?"

"Absolutely," she replies. "I told you it was perfect. I brought along the contract, since I knew you'd want to lock up this offer once you saw everything." She hands you another stack of papers.

You read through it. There's a lot of unfamiliar language, but you try your best to understand. "I see here the mortgage payment would be one-thousand dollars a month," you tell her, "but what's the total price? I don't see anything about how long the mortgage term is."

"That hasn't been decided yet, but they'll let you know when you've paid enough."

You're a bit stunned at this revelation, but the house does sound interesting. "Okay, how soon can I move in? I know you said they weren't ready to give tours yet."

"You can move in once your mortgage is paid off."

"That's not how mortgages work," you object. "I don't even know when my mortgage will be paid off anyhow!"

"I can see you're having some doubts," she responds calmly. "It happens to a lot of people. It's nothing to be ashamed of. I'll tell you what. In a few days I'm having a meeting with my many satisfied customers. Why don't you come along and see for yourself?"

And so, you soon find yourself in a medium-sized conference room with many other customers of your agent. She introduces you to them and tells them about the concerns you've raised.

An older gentleman, in a nice suit, immediately speaks up. "I had the same kind of doubts when I first heard about it. That's only natural. It just sounds too good to be true, you know …


Continue reading

Bayes's Theorem

Posted on Mon, Feb 20 2023 in Bob's Journal

I was surprised that a quick web search for Bayes's Theorem didn't turn up a simple example with an explanation. I could find interesting examples and stories that didn't actually describe how you would apply Bayes's Theorem, and complex math for scenarios that most people never encounter, but there didn't seem to be anything in the middle.

How is it that you can go from trusting a coin toss implicitly to accusing your friend of using a two-headed coin without even examining it? How does your email program know if a message it's never seen before is spam or not? Both of these can be achieved with Bayesian reasoning. Let's walk through the coin toss example. Coin tosses are considered a fair way to pick between two options. In a football game, it's used to decide which team gets to pick their side of the stadium or who receives the kickoff. In other cases, it can be used to decide who gets the last piece of cake or rides shotgun. It's a simple, unbiased process for making decisions between two options where there isn't a good reason to prefer one over the other.

Suppose that you and a friend are making such a decision, and she suggests you settle it with a coin toss. If it's heads, you'll both do what she wants to do. If it's tails, you'll both do what you want to do. You agree. The coin comes up heads and you've got your decision. No arguing or hurt feelings. However, if she keeps getting heads over and over, at some point you're going to think you're being tricked. How did you arrive at that conclusion? Perhaps it's just sheer intuition, and yet there's a lot of math that your intuition is doing (sometimes sloppily) behind the scenes.

Two-headed coins are rare, and (as the name suggests) they can only ever result in heads. I'm not sure how rare, but we can pick a number that sounds about right. I'd say that 99.9% of the time, the coin used in a coin toss is fair. (If you're in a place where people are more frequently using two-headed coins, you can adjust this number accordingly.)

Bayes's Theorem basically says that the probability that a hypothesis is accurate depends on its likelihood (in this case, how likely people are to use fair coins) and the prior and marginal probabilities (how well each hypothesis fits the data). On the first coin toss, when we get a heads, the probability that the coin toss is fair is 99.8%. Obviously, you'd get a heads 50% of the time, so getting one on the first toss isn't that far out of the realm of possibility.

If the second toss turns out to be a heads a well, the probability still remains at 99.6%. However, by the time you've got ten heads in a row, the probability that your coin toss is fair has dropped to less than half and twelve heads in a row is less than 20%. This is based on two-headed coins being rare. If your friend was just telling you the week before about how she found a website that sells trick coins, you might have started with a probability of only two-thirds that it's fair, in which case even the first heads drops your confidence in a fair coin to less than half. Your determination of likelihood can have a big impact on the final probability.

You might be thinking at this point, "but there are more than just 'fair' and 'two-headed' coins in the world!" Of course you're correct. To be rigorous, we should compute the probability of every possible kind of trick coin. This is one of the weaknesses of Bayesian reasoning, though an entirely reasonable one. It can only pick between known hypotheses, not create them for you. If you've never heard of the type of trick coin your friend has, she can continue to trick you with impunity and you'll be none the wiser.

It's also worth keeping in mind that the results are probabilities. Just because the results lean towards one hypothesis, that doesn't mean it's correct, just that it's the …


Continue reading

Flare Gun

Posted on Thu, Dec 22 2022 in Bob's Journal

I was a teenager, attending one of the annual youth conventions that my denomination held. The speaker for that evening told us a story:

A truck driver is driving along the highway at night, on his way to deliver his next load, when suddenly he sees a light in the distance. A second later, a blinding flare smashes into his windshield. The driver slams the brakes and jumps out of the cab to find the person responsible. He is furious. He runs to the guy with the flare gun and starts yelling at him. "What are you doing? I ought to beat you to a pulp." The guy responds that the bridge ahead has collapsed and the flare gun was his only way to keep the truck driver from driving into the ravine.

"This is you," the speaker informed me and my friends. "The bridge is out, and the people around you are barreling down the road of life, headed for a crash. What will you do to protect them from that fate? Is any action too extreme to save their souls from destruction?"

I took the message to heart. I carried my Bible to school every day. I highlighted the verses of the path of salvation in it, and marked each passage with the page number of the next step. I practiced walking through those steps in case I had the opportunity to share the gospel with my peers. I took the occasional barb from my classmates, but it was worth it. Like the truck driver, they didn't yet understand that I was saving them.

It took me two decades to realize this was a false analogy. In actuality I had been walking along the road when someone burst from the woods and handed me a flare gun. "The bridge is out ahead!" he shouted at me. "You have to prevent people from passing this point. Use this flare gun to stop them."

I dutifully began firing at oncoming traffic. Most of the vehicles sped by. A few slowed down to see what was going on, but they eventually kept going. I was a bit too excited to hear what they were saying, but I assumed it was something like "I really want to drive off a cliff and die."

Several hours into the night, when the traffic had slowed down, I began to notice certain facts that had escaped me at first. I hadn't seen a single emergency vehicle headed for the scene of the bridge collapse. Surely someone must have reported it by now. Even more troubling, I would occasionally see cars coming from the other direction. Unable to contain my curiosity, I began walking down the road. Somewhere on my trek I dropped the flare gun along the side of the road. I've been walking for an hour now and haven't seen any sign of a bridge.

To those of you who took a flare to the windshield, I'm very sorry. I was just doing what I was told I was supposed to do. To the guy who handed me a flare gun, please stop. To those of you still holding flare guns, I'm sorry it makes you feel bad that I dropped mine. Please don't shoot me with your flare gun. We can just talk. To all of you heading down the road, good luck. So far it looks just fine.


Elevating Others

Posted on Sat, Dec 17 2022 in Bob's Journal

[If you're not familiar with this year's FIRST Robotics Competition game, here's a short video introduction. It may be hard to understand the following without that knowledge.]

When I first started mentoring on the Krypton Cougars, they were, to be blunt, not very good. They were only in their second year and had limited resources. Through the years that I spent mentoring the team, I watched them slowly become an average team. Occasionally winning or doing well, occasionally doing quite the opposite, a team with growing name recognition, but at best only a competent support robot.

After more than a decade, though, with an impossible number of hours in the books, the Krypton Cougars have been to the world championship twice, most recently finishing on Einstein, the finals of the finals. It's been an exciting journey, even though I've only been able to watch the past few years from the sidelines.

Due to COVID, competitions had been closed to spectators and I haven't been able to watch them in person since 2019, so it was extremely exciting to finally attend Ramp Riot, one of their off-season events, this fall. The team did very well during qualifications, losing only one match and finishing second overall. As alliance captains they chose Roboforce, a competent shooter and with minimal climbing ability, as their first pick. Their second pick was Dawgma, chosen to serve as a defense robot and block scoring by the opposing alliance.

FIRST is trying out a new double-elimination format for their playoff matches this off-season. Before their first match could even start, Dawgma was working on their robot on the field, attempting to get it to connect to their control system. They did not succeed. Their robot never moved the entire match, allowing the opposing alliance to play double-team defense, and just like that the Krypton Cougars found themselves in the losers bracket, with a score of 81 to 94.

Dawgma was unable to repair their robot before the next match, so they were replaced by the highest remaining team, the PSIcotics, a robot that I had first taken note of early in the competition when parts of it started falling off during their match, but at least they could move. Our alliance won easily, staying alive for one more match.

The next elimination match was against the first-place alliance. It was a close match, particularly since all three of the robots on the opposing alliance were capable of climbing, while the only reliable climber on our alliance was the Krypton Cougars, but our alliance managed to stay alive 109 to 106. The following match the Krypton Cougars won handily, but PSIcotics began to have mechanical issues and spent the final minute of the match barely able to move.

Fortunately, by then Dawgma had gotten their issues sorted out, so they returned to our alliance for the final match of the losers bracket. The match started unexpectedly. Literally. Apparently someone accidentally triggered the match too soon. Fortunately, no humans were on the field at the time. The match was stopped and the robots were set up again. The actual match started extremely close, and our second shooter, Roboforce, died near the sideline almost immediately after the autonomous period. With Dawgma playing defense, the Krypton Cougars were the entire offense. The opposing alliance devoted a robot to blocking them the entire match. Trying to score as many points as possible, the Krypton Cougars ran out of time and didn't complete their climb. Fortunately, Dawgma was able to get on the bars, resulting in a final score of 80 to 79. Our alliance was going to the finals.

Now, unlike most double-elimination tournaments, there is a reset built into grand finals, making them best of three. We were now on even footing. During the timeout before the match, Roboforce was able to repair their machine, and the first match of the finals was a high scoring affair, as both teams focused on shooting cargo into the goal. With three functional climbing robots, our alliance was able to pull off the victory with a score of 115 to 105.

However, after the match, the programming mentor said "We're dragging a swerve module." Sure …


Continue reading

Disqus

Posted on Tue, Dec 6 2022 in Site News

It's not quite Hyperwidgets, but I've added comments to the site via Disqus. So, if you feel one of these articles would not be complete without your feedback, feel free to click on the article title. I think it's set up to automatically show new comments, and, failing that, hopefully it will at least tell me when a comment is being held.


Is A Tomato A Fruit?

Posted on Sat, Dec 3 2022 in Bob's Journal

One of the popular gotcha questions in politics at the moment is "What is a woman?". It only has four words, and most of us can identify a woman with only a quick glance. It's used as the primary example of how the "leftists" are ignoring reality, letting their "woke" ideas cloud an obviously simple question. Yet any attempt to answer it turns out to be tautological ("A woman is someone who society accepts as a woman"), overly simplistic ("A woman is someone who can have children"), or tediously long ("Someone with two X chromosomes, plus those with this syndrome but excluding those with this disorder unless...")

This complexity is not limited to matters of gender. Almost everything we deal with on a daily basis suffers the same complications. A common example is the question "Is cereal a soup?" If we try to define the characteristics that make something a soup, we'll likely come to the conclusion that cereal fits the definition, even though we understand intuitively that they're very different things. Or we may overcorrect to suit our intuition and create ad-hoc restrictions that rule out things we know are soups.

The problem, if we want to see it that way, is that our minds are neural networks. We didn't learn what a chair was by being given a rigorous definition. Rather, we were exposed to thousands of examples of things called "chairs" until our brains were trained to recognize them on sight. Any attempt to clearly define a chair with a rigorous definition is post-hoc, and is likely to fall apart at the boundary between "chair" and "not chair".

This is where, in my opinion, a lot of philosophy goes wrong. It wants to break reality down into clearly delineated categories, and reality simply can't be mapped that way. Our artificial buckets serve many useful purposes. They allow us to deal with a complicated reality in a way that doesn't overwhelm us, but that convenience comes with a cost.

Our concepts are situational. What we consider a fruit is very different depending on if we're making a fruit salad or labeling the parts of a plant for botany. It's not enough to ask what something is. We also need to know why we want to know what something is.

In normal conversation we don't trouble ourselves with such rigor. If someone asks us to bring another chair for the dining room table we don't ask for clarification or drag over the nearest recliner. We intuitively use the purpose to arrive at the expected definition.

So, if someone decides to ambush you with "What is a woman," ask them what they hope to achieve using that definition.


Thanksgiving

Posted on Thu, Nov 24 2022 in Bob's Journal

It's Thanksgiving yet again, an increasingly controversial holiday. Like so many have before me, I'm going to ignore all that and just be thankful.

I'm thankful to you for visiting this site and reading my words, even if it's not on Thanksgiving.

I'm thankful to the countless mathematicians, physicists, engineers, and programmers who have given us the internet as we have it today. Without all of their often thankless work, so much of what I do to provide for my family would be impossible, or at least far less pleasant.

I'm thankful to all the doctors and nurses who, despite increasingly unhinged conspiracy theories about their motivations, have kept on doing what they can to keep their patients safe.

I'm thankful to the teachers and librarians who carry on educating everyone who wants to learn, even if that's being made increasingly difficult by those who don't understand education.

I'm thankful to all of the election officials who continue to make sure that democratic elections can be carried out despite increasing distrust and polarization. I'm even thankful to all of the candidates that made election denial a part of their campaign and yet have conceded when it's become clear they've lost.

I'm thankful to the remaining reporters and media outlets who care more about distributing accurate information than pushing an agenda, and are willing to publish true information regardless of who it will benefit.

I'm thankful to the artists, poets, authors, musicians, songwriters, actors, and filmmakers who invest their time and talents into crafting beautiful pieces of art for others to enjoy.

I'm thankful to all the firefighters, EMTs, and social workers who have dedicated their lives to salvaging terrible situations.

I'm thankful to scientists in so many different fields who continue to push forward our understanding of the universe around us, and open the doors to ever greater discoveries. I'm especially thankful to those scientists who use their expertise to help humanity have a reason to be optimistic about the future.

I'm thankful to every person who has the opportunity to act selfishly and instead acts in the interest of others. No matter how small, it's these acts of love and cooperation that give me hope that there are bright days ahead.

Thank you.


Why Change the Site?

Posted on Fri, Nov 18 2022 in Site News

Nearly a year ago I got locked out of my WordPress site due to a malfunctioning plugin. I hadn't been especially prolific for years before that happened, so I let it go. I certainly could have updated the plugin and carried on, but having an active WordPress blog inside my household network was beginning to feel like a dangerous security vulnerability, so I left it alone, figuring if I couldn't log in, at least no one else could either.

A random bot attempted to log into my blog every day, slowly shifting later and later. Every morning I got the crash notification from WordPress, letting me know that my site was still alive, if broken. (Let's ignore when the database ran out of space and everything was down for a month.)

Eventually, though, I began to wonder what it might take to move my website outside my home network to somewhere where a security breach would be less devastating. While WordPress certainly has much to recommend it, it is by no means a lightweight tool, and for what I use this blog for (blatant self-promotion) it seemed unnecessary. I'd heard about static site generators for a while. In fact, the very first Bobland, nearly two decades ago, was built using a static-site generator I wrote myself in C++. I had heard good things about Hugo and decided I'd give that a try. I even went so far as investigating hosting, but somehow I ended up choosing a service that didn't allow customers from the United State. So I gave up.

Several weeks ago I saw something (I don't remember what) that inspired me to check out hosting again. I selected a hosting package signed up for an account, and found out that I didn't have my credit card information saved on my workstation. No problem. My wallet was just down the hall. It only took me a few weeks to get it.

It had been a while since I'd looked at Hugo, and I was curious if it was still the recommended engine. I compared it to Jekyll, and found that the reviews were mixed, so I instead searched for the top static site generators of 2022. On the list I found Pelican, a static site generator written in Python that supported theming with Jinja2. It also supported directly importing from a WordPress export. Those all sounded good to me, so I altered my plan and installed Pelican instead of Hugo. I also set up my server with Nginx, and got my SSL certificate.

My initial import of the old site had some issues, but since the "database" is just files in a directory, I was able to move them around and even clean up the text using Perl. Then it was a simple matter of generating the HTML and copying it to my server, which is nicely handled by a simple command. And now we have the site as it exists today (see the date at the top of the article). As a static site, I don't have comments right now. I guess that's what hyperwidgets are for.


Pelican

Posted on Thu, Nov 17 2022 in Site News

Does this site look different? Yes. That's because I've just recently made the move to Pelican. We'll see how that goes.