Men in Black ethics

I remember really enjoying the Men in Black movies when I was younger. They’ve got explosions, aliens, flying saucers, Will Smith. They’ve got everything that makes a movie great. However, the movies are missing one very important thing: good ethics.

It slipped by me when I was watching the movies as a kid, but humans in the Men in Black universe are kind of the galaxy’s village idiot. In the first movie it’s explained how television, computers, and basically every other technology was given to us by aliens. We’re apparently not capable of developing any of these things ourselves.

In a universe where its easy to travel from one planet to another and there are all kinds of interesting planets with interesting life to visit, we humans are stuck on earth. We get the alien technology that they don’t want: television. They keep their faster than light travel for themselves.

The culture of craft and making that’s seen a resurgence in the past decade or so has me very excited. It shows that people are creative, interested in learning, and willing to build things that make the world a better and more exciting place to live. It’s humans making these inventions, and we celebrate those past humans who invent. People like Philo Farnsworth, the Wright Brothers, and Alan Turing.

When movies like MIB cast humans as incapable of inventing, they do a disservice to our culture and our history.

Why Transform?

I’ve just recently had an epiphany about signal processing. It’s kind of embarassing that it’s taken me so long to realize this, but all the transforms that I’ve been doing in classes are just to make the signal separable from the noise in my data.

That seems pretty simple, so let me back up and explain why it took me so long to realize this. I’ve been taking signal processing classes off and on for about five years now. The classes mostly have focused on a few transforms (fourier and wavelet mostly) and how they can be used to filter an incoming signal. We’ve made low pass filters, high pass filters, and everything in between. It was never quite clear to me why you use the tranform though. You can just do everything in the time domain.

I didn’t put too much thought into that because computations can be easier to do in the frequency domain. What’s convolution in time corresponds to multiplication in frequency. It can be faster to do some calculations in the frequency domain because of that correspondence. I understood that, and thought that I was using some transforms that brilliant people had invented just to speed up their computations. I had no intuition for how they could have devel0ped  the transform. How could they have known the transform would make calculations faster? I put it down to Laplace and Fourier just being more brilliant than me.

What I’ve recently come to realize is that, while Laplace and Fourier were indeed brilliant, their transforms serve a different purpose altogether. The speed up that I got in filter calculations is almost an afterthought to the real purpose of using a transform.

Filters only let through the frequencies that you want. This is obvious when you see plots of filters in the frequency (fourier) domain. I was clear on this from the outset. You use the Fourier transform to select frequencies, gotcha.

For some reason, this knowledge didn’t generalize like it should. I went around saying to myself that filters select different frequencies, and that convolution in time was multiplication in frequency, but I didn’t get that this was the whole point of the transform in the first place. Noise in the time domain is hard to separate from a signal, but in the frequency domain it can be very easy to separate.

And that is the key behind transforms. The real reason you do the transform isn’t so that you can do fast multiplication instead of slow convolution. The real reason to transform a signal to a new domain is because the new domain can make the parts of the signal you’re interested in easier to separate from everything else. That just happens to make the calculations faster too.

This separability comes up in all kinds of signal processing, pattern recognition, and machine learning. A transform may help anywhere where you want to separate one type of thing from another. Making it easier to separate the wheat from the chaff is why you would calculate features before feeding your data into machine learning algorithms.

My understanding of signal processing now revolves around three steps.

  1. Transform the incoming data so that the components you’re interested in are easy to separate from the components you’re not (separate the signal from the noise).
  2. Do whatever calculations you need to in order to get the output that you want.
  3. Transform the output to the domain you need it in; the new domain is usually, but not always, the same as the domain the data had in the first place.

Probability and Logic

When I first started learning math I focused a lot on formal logic and proofs. I had a lot of fun deriving things using induction, proof by contradiction, and simple direct proofs. It’s been a long time since I’ve done much of that, but I find myself thinking a lot about methods of proving things as I learn more about signal processing and statistics.

I spent some time recently studying hypothesis testing and signal detection theory for a classification problem I’m working on at school. What really surprised me about the two things was how similar they were to proof by contradiction. The main ideas in hypothesis testing is

  1. figuring what you want to show (called H1), and
  2. showing that the opposite of that (called H0) is unlikely

This is where the infamous p-value comes from. If you want to show that eating spinach gives people Popeye arms, you start by assuming that it doesn’t. This is called the null hypothesis and is denoted by H0. After you do a lot of measurements on people who have eaten spinach, you figure out how likely are their huge Popeye arms under the assumption that nothing at all has happened. That probability is called your p-value, and if it’s very low then you’ve got your “proof by contradiction”. A low probability that their Popeye arms are due to the null hypothesis indicates that there’s a high probability that something interesting is going on with those cans of spinach.

And because you’re doing statistics, it doesn’t actually prove anything. All it shows is that it’s more likely that spinach has an effect than that it doesn’t. It’s kind of a subtle point, and has led to a lot of mistaken or misleading scientific papers over the past few decades. That’s one of the reasons that a lot of people are calling for different methods of testing hypotheses (such as Bayesian methods [pdf]).

To my mind, Bayesian methods correspond more to a direct proof. That may make it easier to understand and get right, but it doesn’t mean that hypothesis testing’s p-values are useless. There’s room in science for all kinds of methods, just like so many proof methods can be useful. The key is to know your tools and understand their limitations.

And right off the bat we can see one of the main limitations with hypothesis testing using p-values. Since you’re doing something akin to “proof by contradiction”, you can’t compare different options very easily. You can say things like “Popeye arms are likely to be cause by eating spinach with p-value .02” or “Popeye arms are likely to be caused by excessive mastubation with p-value .03”, but you can’t compare those two hypotheses. One may be more likely to be true than the other, but you can’t easily tell just using p-values. Since you’re only comparing individual hypotheses to the null hypothesis, you don’t know how the hypotheses relate to each other.

That said, hypothesis testing and p-values can be a strong technique when used on the right problem; just like proof by contradiction.

Brass and Leather

I finally got around to doing something with the etchings that I did recently. I cut one of the etchings out and filed it into shape. I then drilled a couple of holes in it and shaped them to my wrist. Getting the right curve in the brass was pretty difficult, and I ended up spending a lot of time tapping the piece with a hammer trying to get things just right. Once I was satisfied, two rivets secured the piece to a bracelet that I’d made for it.

The finished Koi bracelet.

To keep a nice edge on the leather bracelet, I cut a strip that was twice as wide as I wanted it and folded the edges over. I used craft glue to keep them in place. I’m pretty satisfied with how it worked out.

The leather store had pretty nice magnetic snaps, which are much easier to use than buttons. The only problem is that they’re thick. The snap doesn’t stand out too much if you’re not looking for it, but I think if I make another bracelet I’ll try the standard buttons.

The snap on the bracelet works extremely well, but it's kind of bulky.

Science and the immorality of propaganda

I believe, hopelessly, that this morality should be extended much more widely; this idea, this kind of scientific morality, that such things as propaganda should be a dirty word.

– Richard Feynman

The philosophy of science is concerned mainly with a search for truth. Science provides a method to find the truth. At his core, a scientist is someone who seeks to bring his beliefs in line with reality by doing experiments to test his beliefs.

The truth is a scientist’s most sacred quality, and anything that hides the truth or confuses it is immoral. Looking around myself at the world that I live in, I see a lot of instances of people hiding the truth, or purposefully confusing an issue, or phrasing things in a misleading way. It’s clear why people seek to hide the truth. If you convince people to do something, you can make a lot of money or get a lot of power. But while this may be good for you in the short term, it seems like it’s bad for society and the world in the long term. Decisions get made not on the basis of what’s best, but on the basis of what has the best propaganda.

Politics and advertising are the two main fields that focus on distorting truth or obscuring it with rhetoric. This means that tasks as simple as choosing toothpaste and as complex and important as choosing a national leader are far more difficult than they need to be. My solution has generally been to avoid all kinds of ads and propaganda, and look for actual data before making a decision.

It would be nice to live in a world where this kind of conscious avoidance of ads wasn’t necessary. We already have social and cultural moral systems that prohibit bad behavior. I propose that we work to incorporate prohibitions of advertising and propaganda in these already existing systems. It won’t even be very hard: just treat advertisers and marketers the same way you treat people who are rude or smell bad. The social stigma will eventually push people away from propagandizing.

Entropy and Externalities

There’s a concept in economics called the externality that my environmentalist friends like to talk a lot about. An externality is a cost that exists for some enterprise, but it’s a cost on somebody other than the enterprise itself. The classic environmentalist example is that environmental damage is an externality for oil companies. Oil companies get a lot of money for extracting oil, and they sometimes don’t bother to take care of the environment as they do that. This is because environmental damage affects the local community, but not the oil company’s profits.

In many ways, it seems to me that an externality in economics is similar to entropy in physics. Entropy in a closed system never decreases, it’s only by ignoring some part of the system that you can say that you’re increasing order. So too with externalities. Those costs created by the enterprise still exist and still need to be paid for. The only reason that a company (or person, or government) can console themselves about not paying for those costs is that they’re not a part of the closed system that is the company and its customers and suppliers.

As the concept of externalities has come to be better understood by governments, there have been attempts to make destructive companies take responsibility for their actions. This seems like what I used to do in my physics classes by redrawing system boundaries to account for entropy. Redrawing system boundaries for economic externalities is usually done by creating laws that require companies to pay for any damage that they may create. One good example of this is Montana, where mining companies have been required to create trusts that are responsible for cleaning up after them.

What’s interesting to me is that the owners and CEOs of possibly damaging companies sometimes realize that they live inside the wider system that encompasses whatever damage is caused by their company. One example of that is Sunoco, which is the only oil company to sign on to the Ceres Principle.

I wonder if a better understanding of physics would cause people to realize the impact of such externalities to other parts of their lives. Even companies that work to mitigate externalities don’t do all that they could. Perhaps CEOs of potentially harmful companies should be required to take a course in thermodynamics to get a good understanding of entropy and system boundaries.

Batteries and Fuel Cells

I’ve been getting interested in energy storage lately; specifically how it can be used to make renewable energy sources more viable. In looking around the Internet, I found out about Lithium-Oxygen batteries. These are batteries that have a carbon anode that allows oxygen from the atmosphere to diffuse into the battery and react with lithium products to produce electricity. These batteries have the potential to have  a much higher energy density than Li-ion batteries because half of their reactant is gathered from the atmosphere.

This is kind of along the lines of how hydrogen fuel cells work. In fact, it turns out that both batteries and fuel cells work through the same chemical processes (called redox reactions). Chemically, there’s no difference between batteries and fuel cells. So if they’re chemically similar, what’s the difference between batteries and fuel cells?

It turns out that fuel cells are just batteries with externally stored reactants. In a battery, all of the chemicals are stored internally and never released. A fuel cell may undergo the same reactions but with reactants that are pumped in from external storage tanks. Fuel cells thus have the benefit of being easy to recharge just by replacing the reactants, but they are more of a hassle to use.

So those Lithium-Oxygen batteries that I was so interested in aren’t technically batteries. The lithium for the reaction is stored internally, but the oxygen is gathered from an external source (usually the atmosphere). This means that half of the device is a battery and the other half is a fuel cell. It has the convenience of a battery with the energy density of a fuel cell; the best of both worlds.

Etching Brass

I ran across the steampunk workshop’s brass etching guide a while ago, and I’ve been meaning to try it out since then. Last week I finally got around to it, and the results look pretty nice.

The process is pretty simple.

Toner stencils

Step one is to print a stencil onto glossy paper (I used old magazine pages) using a laser printer. The laser printer is necessary because the toner can be melted using an iron.

I cleaned the brass I was planning to use by polishing it with steel wool, then rubbing it down with alcohol to remove any oils from my fingers. Next I put the stencil face down on my brass and ironed it. I held the iron down on each stencil for two or three minutes and pushed pretty hard. This melted the toner and stuck it to the brass.

After ironing, the paper was stuck to the toner, which was stuck to the brass. I soaked the whole thing in water overnight, then gently brushed away all the paper. Some of my stencils ended up with a couple of holes, so I painted over those with some acrylic paint.

Brass with stencils

The next step was the actual etching. This involves submerging the brass in a copper sulfate solution and running a current through it. The copper sulfate solution is a very pretty blue.

Copper sulfate bath

The working piece (which you want to remove metal from) gets connected to the positive terminal of an old battery charger I had. I used an old piece of brass about the same size as my working piece as the negative terminal. When I hooked up the battery charger, molecules would leave the surface of the positively charged plate and be deposited on the negatively charged plate.

Etching setup

The etching took about half an hour to an hour, but part of that was because my current was actually too high. Normally a higher current corresponds to faster etching, but in my case the high current caused the battery charger to overheat and shut down. I had to keep letting the battery charger cool before I could restart the etching. I could reduce the current by putting a resistor in series with the brass plates, but it would have to be a very small, very high power resistor.

The battery charger is rated for 6A, but I was running probably 12 to 20 through it. Let’s just assume 16A. That means my brass etching setup probably has a resistance of about 12/16 = .75 Ohms (see Ohm’s law). To drop the current to only 6A, we’d need a resistor that was 12/6-.75=1.25 Ohms. It would have to be able to withstand 1.25*6^2 = 45W. That’s is a beefy resistor.

An alternative to a series resistor is to make the resistance of my etching bath higher. I could do this by using a smaller negative terminal. The negative terminal should be about the same size as the working piece so that it etches evenly, but I think I could get away with using a brass mesh rather than with using a brass plate.

In any case, my etches came out fairly nicely. The holes I patched up using acrylic paint didn’t turn out very well. I think the acrylic paint pulled off while I was etching. Everything covered by toner turned out nicely though. After I had finished the etching, I grabbed some steel wool and polished the whole thing to a nice shine.

Etched animals

Shop Class as Soul Craft review

I’ve been seeing Shop Class as Soulcraft around for a while now. One of the local hackerspaces has a copy, Venkat Rao over at Ribbon Farm put the book on his reading list, and it showed up on the shelves of my local technical bookstore. I put off reading it because I was worried about it being too polemical and reactionary, but with so many people recommending it, I had to give it a chance.

The book, by Matthew Crawford, focuses on how shop class and working with your hands is both economically and morally worthwhile. The author works as a motorcycle mechanic, but has a PhD in philosophy and got his bachelor’s degree in physics. I tend to have a real fascination with people who’ve seen what’s supposed to be good and chosen something else, so just from his background I already like the author. The book itself seemed overly verbose and grandiose. This might just be because the author has a PhD in philosophy, but I think there’s some attempt to be as respectable as possible while praising blue collar work above white collar work. Despite the verbosity, I liked the book.

There was a lot of ground covered in the book, but it seemed to have three main points. Crawford argues that “Blue Collar” work, and any work that involves actually making something physical, is more emotionally fulfilling and economically secure than white collar work. He also makes the argument that making things is a very different way of knowing than simply doing theoretical work. Shop Class as Soulcraft also had a long autobiographical portion, showing how and why Crawford had gotten involved with the mechanical arts.

Work in general is hard and most people wouldn’t volunteer to do it. That’s why they pay you for it. Crawford acknowledges this, but then goes on to say that work that involves some concrete and external metric (such as all work that involves making something) is more fulfilling. It shelters the employee from some of the capriciousness of management. Both the employee and the manager can look at the thing that is built and tell if it meets its criteria. Knowledge workers have no such thing to fall back on, and are thus more subject to the whim of management.

Not only that, the pressure over the last hundred years to put all manual labor in an assembly line seems to have reached everywhere that it could. Any manual fields that have avoided an assembly line are unlikely to be transformed. Repair work, construction, and installation all demand that a person be at a specific place, so those jobs are more or less immune to outsourcing. White collar knowledge work does not have either of these safety nets. Programming, human resources, and similar knowledge work have all begun to face outsourcing and assembly-lining. White collar jobs are no longer as secure or well paying.

Knowledge through doing is something that I’ve been considering more and more lately. I’ve been continually impressed with how much some of my friends know. Those friends of mine who are consistently making things, hacking, or working on projects seem to know quite a bit more about the world. Crawford argues that this is because it is only through making things that we really run into the physical reality of our universe. Only by trying to do something do we find out what’s possible.

One example the book gives of the differences between knowledge through doing and theoretical knowledge is that of shoelaces. According to knot theory, it’s always possible to untie a shoelace just by pulling on one end. It doesn’t matter if it’s double knotted or tied in some crazy way. As anyone who’s hiked up a mountain and come home with wet, muddy shoelaces can attest, this is not true. A mathematically ideal shoelace may have this untie-able property, but in the real world it depends on the quality of the shoelace.

Theoretical knowledge is useful, and Crawford is quick to point out that it is worthwhile, but all problems occur in the real world. Theoretical knowledge can inspire solutions, and even lead to very effective solutions, but you have to be careful that the theory doesn’t assume ideal shoelaces. Also, those without a theoretical background are still capable of doing very intense intellectual work very well, especially if they have a deep well of experience to draw upon.

I found the autobiographical portions of the book very interesting. The author seems to have had an exciting life in many ways, much of it filled with wood working and car or motorcycle repair. I enjoyed reading about his life, but some of it seemed not so much to support his point as to talk about how he arrived at his point.

My main criticism of the book is that it tends to be light on many details. For example, one chapter deals with the construction of the blue collar/white collar separation. Crawford makes the point that this was done explicitly by scientific management devotees. He offers some support, but doesn’t go very in depth into the topic. I suppose that I have to accept that a polemic book isn’t meant to be a history book, but I think Shop Class as Soulcraft could have used more detailed analysis throughout.

Overall I’d say this was a good book. It was a fast read; I got through it in about two days. Reading the book did a lot to organize my own thoughts on work and making things. I don’t think I learned a lot of new things from the book, but I did enjoy it. I give it 5/7.

Ubiquitous Computing Devices

Mark Weiser’s description of the three main Ubiquitous Computing devices was prescient. He named them the tab, the pad, and the board in order of increasing size. I have at least one of each in my house now. This was published about 20 years ago, so our terminology has changed a bit. The tab, wrote Weiser, was a handheld computer. The pad is more the size of a book or laptop. The board was wall sized.

My Android phone definitely counts as a tab, though we call those smartphones now. My Nook Tablet seems to resemble a pad (tabs and pads mean the same thing now). In my living room I have a computer connected to a projector for watching movies; this definitely counts as a board. These devices all embody different ways for consuming media, and in the present day they’re used almost exactly as Weiser predicted with only one main difference.

The pad, as originally envisioned, was supposed to be fairly stationary. A user might carry their tab around, but they’d be able to find pads anywhere. If you can pick up a pad no matter where you go, there’s no need to carry one with you. Pads haven’t become that commonplace yet, but even if they do I don’t think people will stop carrying theirs around. The modern equivalent of the pad, such as my nook, goes everywhere with its owner. One of my friends just bought a new coat because it had pockets big enough for his Kindle. The tab (smartphone) has a screen that’s just too small to be useful when you’re out and about. Even if every table in every cafe eventually has a scratch pad, that still won’t help you when you’re on the bus.

The modern desktop is a much better fit to Weiser’s expectations for the pad. There are desktops pretty much everywhere that you go (work, home, the library). You wouldn’t carry it with you. It’s even the main tool for creating content. When I want to do a lot of work on my smartphone (like write a new app for it) I do that work on my desktop and then transfer it to my phone or nook.

The modern laptop fits more under the tab category, for the same reason that my nook goes there. I still carry it around with me all the time. While touchscreen devices are great for consuming content, they don’t work as well as for creating it. The OCR just isn’t there yet. It may never be, as anyone who’s tried to read my handwriting can attest.

There seems to be place in Weiser’s world for a completely different kind of device. One devoted solely to content creation. Keyboard and mouse work very well for a lot of tasks. I wouldn’t have wanted to write this post on a touchscreen, for example. There are other input tools that people need for more complicated tasks.

The tab/pad combo is getting better as a storage platform and screen, but I don’t think it will ever take over for any kind of content creation. Perhaps as technology improves it will become the main computing device that you use, that carries around your files, your music, your life. When you’re at home, you may plug it into a dock that allows it to interface with larger screens and more appropriate user interfaces (maybe it’ll even do that wirelessly).

In spite of the focus on content consumption rather than creation, Weiser’s vision seems to have come true today. That’s one nice thing about reading old articles. It really feels like you’re living in the future.