What is a machine’s favorite color?

I’ve wondered about the idea of what I call Killer AI, Skynet and terminators and Agent Smiths and those types of things.  Isn’t the idea that the machine would see that humans are a threat to it, and then decide to exterminate the race? What I find puzzling is why would a machine care?

Another model I have in my mind for AI is Mr. Data from Star Trek the Next Generation. Continuing with the idea of a machine caring or not about its existence, many times we saw that Data simply did not care. If you told Data that you were going to switch him off, he would just shrug and be switched off. He had no preference.

My favorite color is blue.  Why do I prefer blue over other colors? I just do right? I’m built that way, so to speak. I came out of the box like that.

How was I built? What process built me? Well, I was built by my mother and father who combined their genetic material to create me. I assume that somewhere in that material is a code that causes me to prefer blue. I would further assume that this code conferred some advantage to my ancestors, that caused them to survive and pass the blue code on. So in the larger sense, evolution built me, and evolution has set me up to prefer blue. Perhaps my ancestors were people who prospered by the bright blue ocean.

In any case, what I am getting to here is that the reason I think I have preferences is they give me survival advantages. This brings me to another point. A more important point. I believe I have code in me that gives me a preference for self-preservation. Or perhaps simply causes my system to attempt to preserve itself.

One specific mechanism of preservation is fight or flight. When I sense that I am  being threatened, my body reacts by energizing me to either eliminate the threat or flee from it.

From a programming perspective, what does my system have to do to be able to self-preserve?

Well, first it has to have some idea of self. Does it? Perhaps idea is the wrong word. No idea is required I think at all. But somehow the system is designed to maintain its integrity.

I can take a hammer and smash my computer to pieces. It will do nothing. However, if I were to try to take a hammer to my dog though I would certainly not, but if I did, he would run away and hide.

How would I model this with a computer program? I know literally nothing about this area, and I am sure it shows. But I find it interesting to think about. So bear with me, and lack of humility in assuming anyone is reading this.

I could create a JavaScript program, say a circle animation.  Suppose the animation were in a loop, and there were other animations that also spawned in loops. So what we have are lets say circle animations and square animations floating around on screen.

One rule we could make would be that if a square collides with a circle, the circle is destroyed. That gives us a threat.

At this point, however, the circle does not care. It has no “preference” for existence or nonexistence. How could it be imparted with a preference? That is very difficult for me to think about.

More easily I could program it to avoid the squares.  That seems a far cry from giving it a systems level integrity bias that I think of as self-preservation. But it might be a start.

By now though you can see where this is going. You probably saw it long before I did. If we programmed computers to care about things, they might not care in the same way we would care, but the effects would be the same. If we programmed a computer to prefer blue, it would prefer blue. In fact, we can program a computer to prefer blue, and it can find blue for us, even if we ourselves can not see the blue.

I see no reason why a programmable construct could not be designed to maintain system integrity. It could also be designed to avoid threats to integrity and also to attempt to eliminate threats to integrity.

I have thought before about a car that would maintain its system integrity. Let’s assume that for a car, to run out of fuel is to die. A computer in the car could be programmed to keep the car fueled and running. With GPS the computer could tell how far it was from a gas station, it could know how many hours of fuel it had left, and distance and so forth, and when it computed that it would run out of gas, it could navigate to a fuel station.

This is a stretch but think of a human driver who ignores the computer and does not stop for fuel. If the computer preferred to have fuel more than it preferred the wishes of the human driver, it could eject the driver or simply lock the controls and take over entirely.

Now we wouldn’t program a computer to do such a thing, would we? Two final thoughts.

  1. We certainly would. Yes absolutely.
  2. Who programmed fight or flight into me? You could say evolution did. Can programmable constructs be programmed to evolve? Certainly, they are now.  Once you put evolution into a self-contained system, how do you control it? Have we stopped bacteria from evolving resistance to antibiotics? At this time we have not, and bacteria are pretty dumb.

My conclusion: a very sophisticated evolving AI will get out of control.


Lower glucose with protein

When I regularly used a glucose meter, I discovered that after a meal of eggs and bacon, my glucose would drop. That seemed odd to me that my post postprandial (after eating) glucose would be lower than my fasting glucose.

What I learned was that insulin spikes in response to protein because it facilitates the absorption of amino acids by the muscles.

However, this insulin increase from protein is a rapid spike and decline. In other words, insulin levels do not stay high for a very long time, as they would in response to a high glycemic meal. There is no reason for the insulin to stay in the system to facilitate fat storage as there is no excess glucose to store. Thus a protein rich meal with no carbohydrate will cause a quick spike in insulin and clear glucose from the bloodstream, and then the insulin will drop.

Dr. Jason Fung says the goal of fasting is to clear the body of glucose and glucose stores such as glycogen. He calls this the refrigerator since this is easy energy for the body to access. According to Fung, once the body runs low of glucose unless glucose is replenished, the body will turn to burning stored fat.

So here is my proposition: Whey protein will clear the refrigerator faster by causing the body to move glucose out of the bloodstream. (Any kind of protein will do, but whey is more dramatic.)

Here is my proposition II: anaerobic exercise will also increase refrigerator clearance by using up glycogen stores and causing the body to rebuild those stores from blood glucose levels.

Aerobic exercise like jogging does not touch glucose or glycogen. Perhaps a little, but it is aerobic exercise and uses body fat to create glucose. Now you would think that fat burning is what you want. But this is a short-term effect, and the side effect is a lowering of metabolism. That means that while you are burning fat as you jog, for example, you actually burn fewer calories going forward because your body is more efficient. Your appetite does not change, and you eat the same amount of food, but you burn less of it and store more of it as fat. Yes, you can push yourself hard enough all the time that you can never eat enough to gain weight. What happens if you get injured or have to stop for any other reason?

Weightlifting specifically burns glycogen and afterward the body pulls glucose back into the muscle to restore lost glycogen. Using Dr. Fung’s analogy, weight lifting is emptying the refrigerator.

We’ve been hearing or a while that HIIT (high-intensity interval training) promotes fat loss more than other kinds of exercise.

Why? A sprint is a high-intensity exercise. What does it burn? What do sprinters legs and butt look like? They are bundles of fast twitch muscle. These are the large glycogen burning muscle fibers.

A sprint, which is a high-intensity exercise, is anaerobic. It is like weight lifting. It burns glycogen.

There is a great protein shake called Premier Protein. It is 160 calories and 30 grams of protein. It’s whey and casein mixed. It tastes great. You can get them reasonable at Sam’s and Costco.

Recommendation I: Try intermittent fasting. Fast for 12-16 hours. The old folks used to say, if you want to lose weight don’t eat after 5 o’clock. This is clearing out the refrigerator of glucose and not putting any back in.

Recommendation II: After an intermittent fast, and really at least twice a week, lift weights at 8-12 reps min/max and follow with a protein shake. (This range is regarded as optimizing muscle size. Not necessarily one rep max strength, but size. My assumption on this without research is that it must cause the muscles to store more glycogen. That would seem to further the lowering of glucose.)

Recommendation III: Get a glucose meter and monitor. You can do all kinds of experiments with it. You can do science like the real scientists did it. In their mom’s basement. You can track numbers in an Excel spreadsheet, and create all kinds of graphics, and do stats on it and play pretend like you are some kind of big data guru. Seriously it’s lots of fun. And you are the scientist of your own self and what more interesting topic of study for you is that?

One final note. What happens to your metabolism when you build muscle? It goes up, and you burn more calories. How many calories do you think a marathon runner burns….at rest. You know the hardcore ones that look like they weigh 130lbs or something? Now think of the Incredible Hulk. How many calories do you think his body requires at rest?

Learn Regular Expressions

Open this tutorial in a window by itself:
Learn Regular Expressions in 55 Minutes

Then open this app in a new window:
Online Regular Expression Builder

Now you can follow the guide and try out the different examples immediately.  Let me get you started. When you go to regexr you see this:


The red is mine. Your patterns go inside the two red forward slashes. Try this – replace everything inside the slashes with a word in the text. Like this:


Now you are off to the races with the examples from the guide.

Thanks to the God of the InterTubes, Joel Norris, for the link to the regexr.com.