Author Archive for Todd Brown

The Reverend vs Spam

by Todd Brown on November 29th, 2016

Thanks to the Reverend Thomas Bayes your inbox is not full of spam.

What does spam have to do with a Presbyterian minister who died in 1761? He was also a statistician and formulated a theorem which bears his name, Bayes’ Theorem. Basically it allows us to adjust the probability of an event given new information that might be related to the event. We can change the probability of an email being spam after getting more information by looking at the contents of the email.

Without Bayes’ Theorem we could look at our inbox and see that on an average day we get a certain amount of spam. The probability that any given email is spam would be the number of spam emails divided by the total number of emails. For example if I received 100 emails today and 70 of them were spam then the chance that any random email would be spam is 70/100 = 70%. But without any more information we still would not be able to predict that any given email was more likely spam than the others. The probability is the same for all of them so not helpful.

But what if we have some new information? What if we know that spam emails often have the word FREE in them? Bayesian Spam Filtering will look through the text in each email, if it finds the word FREE then using Bayes’ Theorem the probability of that being a spam email increases. Spam filters are all a little bit different and look at a variety of things to help them make predictions. Most will have a large list of words, with different weighting, that it looks for. Other things might be if the email has a lot of html tags, the image to text ratio is high, or the subject is in ALL CAPS. The filter is also constantly learning and adjusting the weights by looking at what users have marked as spam. In the end it gives each email a probability and if it is above the threshold set in that filter, then it is automatically marked as spam, put in your spam folder and you do not have to deal with it.

Thanks Reverend!

If you are interested in two slightly more detailed examples of Bayes’ Theorem keep reading.


The basic equation is:

           P(B|A) * P(A)
P(A|B) = ----------------

P(A) and P(B) are the probabilities of A and B by themselves.
P(B|A) is the probability of B if we know A.
P(A|B) is the probability of A if we know B, which is what we are trying to determine.

An intuitive example is if you pull a card from a deck of cards what is the probability that it is a King? We know there are 4 Kings in a deck of 52 cards, so the probability that we drew a King, P(King), is 4/52 or 1/13. Now what if we had some new information about the card? What if we knew that the card we drew was a face card? Now we can use Bayes’ Theorem.

                 P(Face|King) * P(King)
P(King|Face) = -------------------------

We already know that P(King) = 1/13. There are 12 face cards in a deck of 52 cards, which means that P(Face) = 12/52 or 3/13. The last part is P(Face|King). We know that if we drew a King then it is definitely a Face card, so P(Face|King) = 1. Plugging these parts into Bayes’ Theorem gives us:

                 1 * 1/13
P(King|Face) = ------------- = 1/13 * 13/3 = 1/3

Having the extra information about the card changes the probability that it is a King.

A counterintuitive example is testing for a disease. If we know that 1% of people have a disease. The test for the disease is 90% accurate. If you have the test done and it comes back positive what is your chance of having the disease? The intuitive, but wrong, answer is that you have an 90% chance of having the disease. Let’s use Bayes’ Theorem again.

                           P(Positive Test|Disease) * P(Disease)
P(Disease|Positive Test) = --------------------------------------
                                     P(Positive Test)

The tricky part on this one is the P(Positive Test). Of the 1% of people who have the disease it will correctly give a positive result 90% of the time. But, of the 99% who do not have the disease it will incorrectly give a positive result 10% of the time. The resulting formula is:

                                  .9 * .01
P(Disease|PositiveTest) = ------------------------- = 8.33%
                           (.9 * .01) + (.1 * .99)

That means that instead of a 90% chance of having the disease, you really only have an 8.33% chance of having it. In this case knowing the accuracy of the test makes a very big difference in how the test results should be interpreted.

Voronoi and Delaunay

by Todd Brown on June 3rd, 2016

voronoiDo you know what Voronoi Diagrams and Delaunay Triangulations are? I did not until a few weeks ago.

Basically a Voronoi diagram is a set of convex polygons, like in the image to the right. They are created from a set of points called seeds. All of the points within each polygon are closer to that polygon’s seed than to any of the other polygon’s seeds. The points along an edge are the same distance to the seed points of those two polygons. The point at each vertex is the same distance from at least three seed points.

Still with me?

The Delaunay triangulation is a set of triangles connecting the seed points of each polygon to its two nearest neighboring seed points.

So what good are they?

There are a lot of uses for them. If each seed point was an obstacle to avoid then a self-driving car could use the edges of the Delaunay triangulation to find the safest path through the obstacles. John Snow created a Voronoi diagram of London showing that cholera deaths of 1854 were closer to one water pump than to the others. You could even draw a Voronoi diagram on a map using coffee shops as the seed points, so you would always know which one you were nearest to. There are many applications in many fields, like chemistry, biology, astronomy, mathematics, 3D graphics, telecommunications and so forth.

Of course you want to draw one by hand, so here is how:
Start off with some random points on your paper. These are your seed points. The more points you add the more complex the diagram becomes the more time it takes to draw.







Make the Delaunay Triangulation by connecting the points.







Find the middle point on each side of the triangles. Draw a line perpendicular to each side at that midpoint. These lines become the sides of the polygons and the points where they intersect are the vertices of the polygons. Below, the blue lines are the Delaunay Triangulation and the red are the Voronoi Diagram.








Release the Kraken

by Todd Brown on February 25th, 2016

JacketOne of my children may have an interest in marine biology as future career.  I thought it might be fun for us to take scuba lessons together. I investigated doing this for myself last summer but ran out of time.

The deep end of a swimming pool has always made me uncomfortable. I wouldn’t call it a fear as much as a strong unease. I can swim fine but I do not know what could be lurking beneath the surface waiting to drag me down. It is kind of like the feeling when you are walking up the stairs from the dark basement, but stronger.

The Professional Association of Diving Instructors (PADI) offers courses to get people certified in various levels of scuba diving. I was interested in the very first level which is the Open Water Diver. Eastern Iowa has 3 or 4 shops that offer the course. The first part is usually an taken online with a computer or offline on a tablet. After that is finished, the next step is confined water dives. You get to put on all of the equipment and apply what you have learned so far. I can handle 8 hours in a pool where I can touch the bottom if I need to. The next part, which is sometimes a separate class, is the open diving. This is where I will have to overcome my strong unease. Open dives can be done through any PADI dive center and there are a lot of different places where they do the dives. Some are in a quarry near Cedar Falls, some are in Lake Michigan looking at wrecks, others are in the ocean off the coast of popular vacation spots.

The Library has a few books on scuba diving which I looked through. I immediately flipped to the indexes and made sure none of them listed Kraken, Dagon or mermen. But I do see things like barracudas, scorpion fish, fire coral and territorial biters!

Domo arigato

by Todd Brown on December 22nd, 2015
Domo arigato Cover Image

Admit it. You want to build a robot. You just saw Star Wars and you still need to get some gifts for your family. I get it. It makes perfect sense to build a robot. When you think about it, who would not want to build a robot?

The problem is that wanting to and having the skills to are very different things. After all, there are a lot of wires, flux capacitors and doodads in there that you have no idea how to connect to each other. Not to mention which end of a soldering iron you should hold. It makes a big difference and I have the scar to prove it. But guess what, the Library has books on all of that.


electronicsMake: electronics : learning by discovery

Start with the basics. Positive is +, negative is -.





Make : more electronicsmoreelectronics

Then go beyond the basics.





arduinoMake : Arduino bots and gadgets : learning by discovery

This will give your robot a brain. It won’t clean your house, but you have to learn how to crawl before you can clean the house.






Make : sensorssensors

You want your robot to interact appropriately with it’s surroundings so it is going to need sensors. Otherwise it will just walk into walls and ignore you when you tell it to clean house, sort of like teenagers.




Make : 3D printing3d

You might not have all of the gears and exoskeleton parts just lying around. With a 3D printer you can create almost whatever parts you need.





Make: rockets : down-to-earth rocket sciencerockets

Will your robot have a jet pack or maybe foot thrusters? Yes it will.





Thrusters probably need rocket fuel of some sort.






Make : wearable electronicswearable

If you need a gift for someone with automatonophobia but still want to give them something made of wires and leds this might be good book to look at.






Next year start shopping or building sooner. You are welcome.

Street Art

by Todd Brown on November 12th, 2015


At my desk I can look out across the alley to the backside of another building. The largest surface is a brick wall painted bright white. On sunny days it can be almost blinding. Occasionally there are messages scrawled across the wall or on the HVAC units. Often it is a one word tag that has no meaning to me. It cound be a gang, a sports ball team or maybe a character from My Little Pony. Not long ago new text was added. It says “I feel lonely.” It isn’t in a fancy graffiti font, just plain cursive. Without knowing any specifics I think most people can understand this one.



badBad Graffiti by Scott Hocking As the title implies it is full of crudely drawn pieces of anatomy, references to bodily functions and just plain bad graffiti.




worldThe World Atlas of Street Art and Graffiti by Rafael Schacter On the flip side, this book is filled with beautiful pieces of street art. It includes some artists you may have heard of like Banksy and Shepard Fairy and plenty that you have not. It goes beyond just graffiti to include commissioned murals, paper graffiti and installation pieces.


flipFlip the Script by Christian Acker If you are interested in graffiti AND you are a font geek then this is the book for you. It is page after page of graffiti writing styles used across the country. They are grouped geographically, showing which group or individual used it and in what time period.



historyThe History of American Graffiti by Roger Gastman and Caleb Neelon I liked this one because of the photos, especially the large graffiti done on trains and subway cars. It makes me want to watch Beat Street again.





Rabbit hole of enlightenment

by Todd Brown on April 30th, 2015

Have you ever watched a video on Youtube, which then led you to another and another. Then you realize you have fallen down the rabbit hole. I sometimes do that with books. I will be reading a book which references a person, a subject or another book. So I will run out to the stacks to see what we have on that. This leads to having multiple partially read books, which I may or may not ever finish.

10% Happier

10% HappierIt started when I saw this author on one of the morning talk shows and ads for it kept popping up on websites. He suffered from PTSD, drug abuse and a lot of bad choices, leading to an on-air panic attack during a live news broadcast. The book is about his search for a way get his head on straight. Along the way he meets people like Eckhart Tolle, Depak Chopra, and Ted Haggart.





Full Catastrophe living

Full catastrophe livingThis is one of the authors and books mentioned in the previous title. Kabat-Zinn started the Stress Reduction Clinic at the University of Massachusetts Medical School, to help people dealing physical and mental traumas. I made it about half way through this book before…






The Obstacle is the way

The Obstacle is the wayWhile reading, online either about Kabat-Zinn or meditation in general, I found this title on the Tim Ferris book club list. It is a collection of stories about a lot of successful historical figures and they would turn losses into wins. It leans heavily on the stoic philosophy of Seneca and Marcus Aruelius. I actually didn’t read this, I listened to it in the car. I feel like I miss things because I am not entirely focused on listening while I am driving.





Meditations and The stoic philosophy of Seneca

The Stoic philosophy of SenecaMeditationsThe previous book had a lot of quotes from these two men so I thought I would checkout more of what they actually said. Sadly, I am not sure if I opened either of these books. Maybe some day.





A guide to the good life

A Guide to the good lifeSince I wasn’t going to read the previous two I thought I would at least try to find something else which would summarize their works. The cover looks sort of depressing but it really isn’t. It starts with a brief history of Stoicism, followed by general psychological techniques such as negative visualization and meditation. It also gives advice on  specific problems like handling anger, dealing with insults, and death.





The Nerdist way

The Nerdist wayReading through all of the above books I saw a lot of things which I thought would be helpful for teens, I have two of them. But I knew mine would not have any interest in investing the time in those books. I stumbled across this one which seemed like it might be a little more appealing to them. I don’t know if I would put them in the nerdist category, but they are both gamers so I thought that aspect might draw them in. Plus the Body section has illustrations of a bear with a headband doing exercises! It is divided into three sections Mind, Body and Time. I made it through most of the Mind section before I passed the book on to my son. He seemed interested in at least looking at it.



5 books that I have not read

by Todd Brown on April 24th, 2015

At least I haven’t read them in the way that most people read books. I mostly read nonfiction, usually how to do or make something instead of just facts. I rarely read books cover to cover. I skim them and find the parts that either have the information I am looking for or a part that grabs my attention. That makes writing about books a little more difficult for me. While searching through my Reading History to find something to write about I noticed a few recurring themes.

I have always been fascinated by patterns. One small thing repeated over and over can create something big and beautiful. This has been a repeating pattern in my reading history. I would check them out, head to the craft store for supplies and see what I could make. Below are a few of many I have checked out and have not read.


The complete book of decorative knots

knotMy parents were a little confused when I asked for a book about Turk’s head knots for Christmas a few years ago. But it came with a little, adjustable tool and hundreds of knot patterns to make. The Library doesn’t own that book, but we do have several about knots. The complete book of decorative knots is one I have checked out several times. It is well illustrated and covers Turk’s heads as well as globe knots, mats and a variety of other knots which look pretty cool when done.




Chain maille jewelry workshop

chainFor a little while I was slightly obsessed with chain mail, as well as Viking knitting. The Library has several books which cover the basics of making chain mail. I think all of them have projects that they work through step by step. Most also have gallery sections to show what various artists have created with chain mail to help you find some inspiration.




Origami tessellations

tessI liked this so much that I bought my own copy. This involves a LOT of paper folding to make grids and then making patterns by folding the grid in different ways. These look great and if you put a light behind it you get a totally different pattern. Twofer! I adapted one of these patterns to make a lamp shade for a lamp I built.




Unit polyhedron origami

unitThis is another one that I bought. Also another one that I used for two lamp shades. Basically this is folding a piece of paper into a interlocking shape and then doing that over and over until you have enough of these shapes to assemble them into a variety of larger geometric shapes.




Arm and finger knitting

armBefore the Library owned this book I made a great infinity scarf for my significant other. I was kind of excited to find out we had purchased this book. Personally I didn’t care much for most of the projects in it but it does still show how to arm knit in general. Once you know that you can go out and find or make your own patterns to knit.



Read the rest of this entry »

Return of the Sheep Man

by Todd Brown on March 27th, 2015
Return of the Sheep Man Cover Image

I saw an online review for the latest book by Haruki Murakami called The Strange Library. It has been several years since I have finished one of his books. I have started a few but never followed through and read the whole things. I didn’t even read the review, just the title of it, but that was enough. How could I, or anyone for that matter, resist a book involving a cannibalistic librarian?

Murakami’s fiction frequently falls into the genre of Magical Realism. A lot of odd things happen in his books. Most of the time the bizarreness of the situations are not really addressed. We never find out exactly why these supernatural and surreal events are happening. If not having all of the answers bothers you then his books might be frustrating for you. I  like the lack of explanation. This is the world where the events take place and there is no need to explain it all. 

As I began reading this short story I started feeling a bit of nostalgia for the first books of his I read: Dance, Dance, Dance and A Wild Sheep Chase. I remember very little about the books but I know I enjoyed them at the time. I remember that the main character like to iron clothes, which I can relate to, and I remember there was a character called Sheep Man. I had forgotten about Sheep Man until he reappeared when I read this fairy tale last week.

Don’t worry, we can help you find information about tax collection in the Ottoman Empire and none of our staff have cannibalistic tendencies. At least not that I know of. 



Now with twice the searching power!

by Todd Brown on February 5th, 2015

Did you know that you can search for articles directly from the catalog, without retyping your search into a separate database?

From the catalog’s homepage,, make sure you are using the default “Catalog Pro” tab. Type in your search and press Enter.



The search results screen will display the first three results for materials in our collection which you can check out. Directly below them is a section labeled “Top results for articles:”. This will display the top 3 articles matching your search terms. Depending on which formats the articles are available, there will be buttons labeled “PDF” and “Full Text”.


If you are here in the Library you will be taken directly to the article. If you are not in the Library you will be asked to log in with your Library card number and the password that you created for your card, then you will be taken to the article. If you do not have a password or cannot remember what yours is, you can fix that on this page,


If those three articles are not enough, you can view more results in a couple of different ways. One way is by clicking on the link under the third article.



Another way is to click on the “Articles” tab beneath the search box and next to the “Catalog” tab.



Once you are viewing the Articles tab, there are a variety of ways that you can narrow your search. On the left side of the screen you can narrow your results to magazines, newspapers or books by choosing the appropriate database. This is also where you can also narrow your search by subject, title and place.



By using this tool you will be able to locate articles much faster and without having to leave the catalog.

Happy Searching!

Carcosa and The Yellow King

by Todd Brown on August 30th, 2014

King In Yellow

Fans of True Detective have heard of Carcosa and The Yellow King but might not know where they are originally from. I did not until Candice pointed it out to me.

Carcosa was first mentioned in the short story “An Inhabitant of Carcosa” by Ambrose Bierce in 1891. A few years later Robert W. Chambers used Carcosa, and a few other locations that Bierce mentions. It was in a collection of connected short gothic horror stories, “The King in Yellow”, published in 1895. Four of the stories are connected by references to a work of fiction also titled “The King in Yellow”. In the stories anyone who reads the this meta-book is purported to go completely insane.

The stories have a very gothic, Lovecraftian feel to them. They are tales of supernatural powers which are just out of sight and the madness that it brings. This little known book has influenced a lot of authors (as well as RPG game developers). Many authors have either mentioned Carcosa or expanded upon the Carcosa mythos. It has been used by H.P. Lovecraft and many writers of the Cthulhu  Mythos. Other writers like Neil Gaiman, Alan Moore and George R. R. Martin have locations named Carcosa in their works.

Here is a short excerpt from the book within the book, hopefully it will not drive you mad. You may recognize it from the journal of Dora Lange, one of the characters from True Detective.

“Along the shore the cloud waves break,
The twin suns sink behind the lake,
The shadows lengthen
In Carcosa.

Strange is the night where black stars rise,
And strange moons circle through the skies,
But stranger still is
Lost Carcosa.

Songs that the Hyades shall sing,
Where flap the tatters of the King,
Must die unheard in
Dim Carcosa.

Song of my soul, my voice is dead,
Die thou, unsung, as tears unshed
Shall dry and die in
Lost Carcosa.”

—”Cassilda’s Song” in The King in Yellow Act 1, Scene 2