46 Apples http://46apples.com/index.html Surely you're joking, Mr. Delport! Sat, 26 Jan 2019 14:56:55 +0000 en-US hourly 1 SitePad Why does the universe exist? http://46apples.com/blog/why-does-the-universe-exist.html http://46apples.com/blog/why-does-the-universe-exist/#respond Sat, 26 Jan 2019 14:56:39 +0000 http://46apples.com/blog/why-does-the-universe-exist.html

  • Big Bang and Cosmic Inflation

Hello everyone,

 

Today’s topic is a big one! It is very closely based on a paper I came across on the Archive web site a few months ago entitled Why Is There Something, Rather Than Nothing?. It’s a mix between physics and philosophy, and anytime you throw philosophy into the mix, it’s never a simple, short or sweet matter. This blog will be more lengthy than my previous articles, but it may also turn out to be the last for a while due to other upcoming time constraints.

 

So, why does the universe exist? Why is there something rather than nothing? Why is there anything at all? I will give you an answer. I will discuss various different answers. This is not the kind of question that is really straightforward to definitively answer in a way that everyone agrees, but I’ll try to sketch out some of the possibilities. It’s obviously a big question, the very biggest questions.

 

This is a famous problem. Why does universe exist? Why is there something rather than nothing? It’s a famous way of putting it. I’m not an expert. I’m not sure what it means to be an expert on this question.

 

“God made the universe” is going to be a popular answer. You can’t deny that. So if you think about that, is that the right answer? What is the evidence one way or the other? Does it hold up? Is it the best way of thinking about things? In recent years, it’s the kind of topic that pops up if you google “why is there something rather than nothing?” Why does the universe exists? You’ll get plenty of hits. And I think that there’s been a misimpression that a lot of people have gotten. So part of the purpose of this blog will be to correct some misimpressions. And by misimpression, I’m referring to the idea that advances in modern physics have answered the question, “why does the universe exist?”

 

Advances in modern physics have shed light on what it means to ask the question. They have given us new ways of thinking about what would qualify as an answer, but they have not told us what the answer is. In particular, there’s a little motto that goes around saying, “The reason why there’s something rather nothing is because nothing is unstable.” And this has something to do with the quantum vacuum state. The motto, “Nothing is unstable” was invented by Frank Wilczek, Nobel Prize winning physicist. And he wasn’t really referring to the question of why there’s a universe at all. He was referring to the question of why there is matter in the universe. In particular, why there is more matter than antimatter. We don’t know what the right answer to that question is, but you can try to explain it in terms of the instability of certain quantum states.

 

I think if there is any answer to the question of “why is there something rather than nothing?”, the answer is, there isn’t an answer. The answer is that the issue of the existence of the universe is not the kind of thing to which we can attach why questions and why answers. This is why it becomes more of a philosophical question.

 

Why is there a universe at all? Why does reality exist? Plato and Aristotle had different opinions about how the universe came to be. Plato had his idea of the Demiurge and so forth. Aristotle invented his idea of the unmoved mover, which is basically God.

 

But the issue of maybe the universe might not have existed was not really a hot topic back then. It wasn’t until Gottfried Wilhelm Leibniz in the 18th century, one of the co-discoverers of calculus along with Isaac Newton. Leibniz was a very influential philosopher and physicist even though the word physicist wasn’t that popular back in the day. It was Leibniz who first posed the question in the modern form, “Why is there something rather than nothing?” It was later dubbed the primordial existential question. We can’t demand that there is a satisfactory answer however.

 

Leibniz in particular was trying to develop an idea that he had called The Principle of Sufficient Reason. The principle of sufficient reason is basically says that “Everything happens for a reason.” Basically, he says that anything that occurs in the world does so, for a good reason.

 

This seems reasonable, right? Now when we see things happen, they don’t just randomly happen. There seems to be a pattern and orderliness to nature. So things happen for reasons why and Leibniz says this is a rule. He says it’s not just something we happen to notice that things happen for reasons, it’s something that will always be true – an absolute foundational principle of how reality works. And if you say that, then of course, the existence of the universe is something that has a reason. The universe happens, it exists. So Leibniz says clearly there’s a reason why the universe happens.

 

Leibniz and his philosophy was “I know what the reason why is – it’s God. God created the universe.” That’s a very simple answer. Now, as very clever sophisticated, highly educated 21st century thinkers, I’m sure you’re sitting there thinking, “But wait a minute, what is the reason that God exists? Isn’t there a worry of an infinite regress here.” Leibniz’s thought of this was “No, no, no, God is his own reason.” That’s the unique thing about God, unlike the universe, which may or may not have existed. God necessarily exists. So God is the one thing that doesn’t need an external reason other than himself. God is his own reason for existing and he is the reason for everything else existing. So if you can buy that, if you can buy into this framework, it is at least consistent. It’s at least self-contained. It does provide answers to the questions that we’ve imposed.

 

It’s not necessarily been a very popular idea since then. It depends on your attitude towards other questions. Roughly speaking, if you’re religious, this sounds like a good strategy. Everything needs a reason. The universe’s reason is God, and God’s reason is his own self. The famous Scottish philosopher David Hume scoffed at this idea later on. David Hume said “I don’t see any reason why there should be a necessary being. How do you know that something like God is a necessary thing?”

 

Hume pointed out that all the arguments in favour of the idea that God is a necessary being are basically circular. They come down to the idea that you insist that everything has a reason, that nothing can just be. If you don’t insist on that, then the universe can just be. Maybe some things don’t happen for reasons. Maybe there aren’t necessary beings. And this has been a widely accepted point of view among at least many philosophers and thinkers ever since then.

 

The 20th century philosopher Bertrand Russell put it very straightforwardly. He said, “I think the universe is just there. And that’s all. It’s a brute fact. That’s all there really is to it.” On the one extreme, there is a definite, definable, point-able reason for the universe existing, and it’s God or something else. And on the other side of the spectrum, you have it just is. In between, you have “Well, the universe didn’t have to exist in this particular way but there is something nice about the universe as it is. There is something special, maybe more elegant, beautiful, better this way of the universe existing than not existing.”

 

Let’s be a little bit more careful about what we mean by why something might exist. In other words, what we’re asking is, what do you mean when you ask why something is the case. What is the kind of answer that would possibly satisfy you? And this is a hard question. We’ve all had or at least we’ve witnessed the experience of a little kid asking some why questions – “Why is the sky blue?”, and someone says, “Well, the light from the sun is reflected differently, whether it’s blue or red.”,  and the kid asks “Well, why is the light deflected differently?”, and you answer, “Well, it’s because of the molecular structure of the molecules in the air and how they interact with light.”

 

Then the kid can ask, “Well, why is the molecular structure that way?” And you can talk about Schrodinger’s equation if you wanted to, but usually you just say, “Stop asking these questions. It just is that way. Okay?” Given any answer to the question, why are things one way, you can always ask, “Well, why is that true? Why is that the case?” This is what Leibniz was trying to wriggle around by saying that, “God is the end, the buck stops at God. He’s necessary and you’re not allowed to ask why he exists. He exists for his own reason.” But if you don’t have that option to go to, then you can just always keep asking more and more questions, and it goes potentially infinitely far.

 

One kind of answer would be the mechanism that might bring something into existence. In the case of the universe in particular, you might have a physics theory that explains why the universe came to be through the workings out of some laws of physics. That would be a mechanism that brings the universe into existence. As opposed to that or at least next to that, there is the reason why that particular mechanism worked at all. If you have a mechanism that explains the Big Bang, why the universe came into existence. Well, why is that mechanism right? This is the more traditional sense of why the universe came into existence.

 

So these roughly correspond to this idea of a mechanism and a reason correspond roughly to what Aristotle called the efficient cause and the final cause. There are details that are different, but it is important to discuss both the mechanisms that could have brought the universe into existence if any, and the reasons why that might have happened in a particular way that it did. You’ll not be surprised to hear that talking about mechanisms is relatively straightforward. That’s a physics problem.

 

What happened at the Big Bang, before the Big Bang? Are there more than one Big Bangs? These are not easy questions, but they lie squarely within the realm of what we know and love as physics, as cosmology. We know how to talk about these. There are probably equations involved in them. The idea of reasons why. The reason why this particular mechanism worked, the reason why the universe is one way rather than another is harder. Physicists can say, “Gravity is attractive because of the sign of Newton’s constant in the equations of motion.” But if you ask, “Okay. Why? What is the reason why Newton’s constant has a certain sign?” physicists might say, “Well, it has to do with the stability of the vacuum state” But if you keep asking these why questions like a little kid, eventually they’ll just say, “No. That’s just how it is. Those are the laws of physics that we discovered.”

 

And the reason for this, the reason for the existence of reasons in this particular way, is that Modern Physics talks about the universe in terms of laws of physics, which are patterns. You start with a particular state. Here’s the universe with all the stuff in it doing different things. And then you have an equation that says, “Starting from this stuff, here’s what’s gonna happen next.” That’s true whether it’s Isaac Newton’s Equation of Motion, or Maxwell’s equations, or Einstein’s equation, or Schrodinger’s equation. This is the paradigm that physics works under.

 

The actual reasons that we know and love, that we would say in a more intuitive everyday situation are emergent. They are not fundamental. So if you’re talking about the fundamental laws of physics, you’re speaking a language of patterns of this happens, then that happens, then that happens, then that happens. That’s how the laws of physics work. All the talk that we give about reasons why are at a higher level of description. It’s an approximation. It’s a useful way of talking about the world and sort of a coarse, grained, approximate way. The human scale reality is one where talk of reasons why makes perfect sense.

 

But we have no right to demand that the same kind of reasons, the same kind of vocabulary has any applicability at all to questions like, “Why is there a universe? What happened at the Big Bang? Why are the laws of physics the way they are?” There might be answers to those questions, but we don’t have the right to demand it. We have to be open minded.

 

Now, let’s go to the question of what does it mean to say something versus nothing. What do you mean to ask when you ask about why does the universe exist? And here there’s again, two sort of sub-questions that we’re aiming at. One is the question of we look at the universe, we can think of the universe as there’s space. Space is the arena where things happen. I’m here. Someone else is over there. There are planets and stars up there. And there’s stuff in the universe. Me, planets, stars, and so forth. And you can ask, “Why is there stuff?”

 

You could define nothingness as not an absence of the universe, but as simply empty space in some sense. If we had space but no stuff in it, that would be a kind of nothingness. It would be like the vacuum in some sense. Maybe there’s a question of why there is matter in the universe. This is kind of the question that Wilczek was getting at when he said, “Maybe nothing is unstable.” That’s one kind of question. The second kind is, why is there a universe at all? Why is there space itself? Forget why there’s stuff in space. Why are there three dimensions of space? Not just versus 10 dimensions, but why are there dimensions of space at all? This is harder.

 

The second question is probably what people have in mind when they’re Leibniz or Hume or Russell, when they say this question about why the universe exists, why there is something rather than nothing, but it’s harder. And therefore, there is a common strategy among people who claimed to have answered the question of why there is something rather than nothing. Which is that really they’re answering why there is stuff inside the universe, not why there is a universe at all. These are both interesting question, so we can talk about them a little bit, but let’s just be clear what’s going on. We don’t want to claim credit for answering one question when we’re really addressing another one. The why is there stuff in space versus why is there space at all.

 

So, what do we mean by space? This is, at this level of carefulness and asking these questions, some of the easiest, most obvious things that you think you’re familiar with need a little bit more careful consideration to make sure we know what we’re talking about. After all, there was this guy, Isaac Newton, who gave us a wonderful theory of physics called classical mechanics (also sometimes known as Newtonian mechanics). One of the features of Newtonian classical mechanics is that, again there’s stuff in space evolving with time and that space and time are both themselves absolute. There’s something called space, it’s absolutely agreed upon and objective, everyone agrees on what space is. Everyone agrees on where things are, how they’re moving through the universe. There was an absolute notion of where you are in the universe in Newtonian spacetime.

 

So, if you naively take Newton’s paradigm, he gave us equations. He said, “Here’s how gravity works. Here’s how inertia and forces work and so forth.” He gave us rules for saying given some stuff scattered through space, how does it evolve with time? Time itself is absolute just like space. So again, naively, because these are theories. Newtonian mechanics is a theory suggested by Newton. You might imagine ways to tweak the theory, to slightly change it. By naively, it means what is the most straightforward direct implication at face value of a theory like this? Not that it is an absolute necessary part of that theory. Anyway, naively, Newton’s theory implies the universe is eternal. Space and time just are. They exist. Time extends from past infinity to future infinity. There’s nothing in Newton’s equations that says the universe has to begin or end. There’s stuff moving in the universe and that will just keep moving forever and ever. That’s the straightforward reading of Newton’s equation.

 

Now, Newton himself thought that God was responsible for the universe. Newton was very religious in this sense, and he was very happy to talk about how God had something to do with the universe. Not just bringing it into being. Part of what he said was that the beauty of classical mechanics of this framework he invented was so beautiful, it had to be God’s design. But he also believed that maybe it wasn’t quite beautiful enough. He was smart enough to know that the kinds of questions he was interested in were planets moving in the solar system. Explaining the motion of the planets in the sky. And he was smart enough to know that in his theory, unlike his predecessors Kepler and Copernicus and so forth, not only did the planets move in the gravitational field of the sun, but the planets had their own gravitational fields, so they would influence each other.

 

So they wouldn’t simply orbit the sun forever. They would nudge each other off of their orbits. Ultimately, the solar system should be unstable. So, Newton actually thought that God would occasionally come in and clean things up. That he would fix the orbits of the planets to keep them going for however long that was necessary. Again, that was part of his thought that was not popular. Later on, Pierre-Simon Laplace, circa the year 1800, was very definite that he thinks that the universe can be explained without an interventionist God. That the universe can simply obey the rules of classical Newtonian mechanics.

 

These rules, by the way, don’t change that much for our present purposes when it comes to 1905 when Albert Einstein puts the final finishing touches on the special theory of relativity. You may have heard that special relativity says that space and time are not absolute anymore. They are part of one four-dimensional thing called spacetime, and that’s true. But, in special relativity, spacetime is absolute. So you might not agree on where you are in space but everyone agrees on where they are in spacetime. And furthermore, that spacetime is just a background. It’s there. We all live in it. And again, straightforwardly, if you obey the equations, spacetime exists forever. It goes from the past infinity to future infinity. So, special relativity doesn’t really change the question, why is there something rather than nothing, in either special relativity or classical Newtonian mechanics. There’s just a posit that this is space or spacetime and there’s stuff in it and it’s going.

 

There was really no explanatory apparatus that you could reach for within the theory itself. That did change 10 years after special relativity when Einstein put the finishing touches on general relativity. In the general theory of relativity, now spacetime is still very important. The difference is that spacetime is now dynamical. In general relativity, spacetime is not a mute fixed unchanging background on which everything else happens. Spacetime is a player in the game. The force of gravity, in the general relativistic way of looking at things, is a manifestation of the curvature of spacetime. So when you have matter and energy that forces spacetime to curve, when you have curved spacetime, that pushes around the matter and energy in what is known as the law of gravity. “When an apple falls from a tree,” Einstein would say, “that’s because the Earth is curving the spacetime in the vicinity of the apple tree.” So that’s a little bit of an important change for our present purposes.

 

In general relativity, spacetime is not this separate thing. It’s not just the stage on which the drama is being played out, it’s an actor in the drama itself and it didn’t take too long. In the 1920s, people realised that the universe is expanding. Edwin Hubble and his collaborators showed that not only are galaxies moving away from us, which everyone knew, but Hubble measured the distances to these galaxies and discovered that galaxies that are further away are moving away from us faster. In other words, the universe as a whole is getting bigger and everyone instantly realised if you wind the clock backwards, if things are moving away toward the future, they were closer in the past and there was a solution to Einstein’s equation that said, “You know what? Everything is just going to hit.” Sometime in the past, some number of years, everything in the universe is on top of everything else.

 

Georges Lemaitre, the Belgian priest who was one of the founders of this idea, called it the Primeval Atom, and today we call it the Big Bang. That moment, which we now know was about 14 billion years ago when everything that we know about in the observable universe was in the same place. According to the equations of general relativity, the Big Bang is a beginning. If you trace what happens backward in time, unlike in Newtonian mechanics or special relativity, in general relativity there is a singularity past which you can no longer push the equations. It is no longer true in general relativity that just because we’re here now and there’s stuff in the universe and it’s moving around, that stuff was always here.

 

There can be a moment in time when the universe comes into existence and the Pope at the time said this is brilliant, this is just what God said in the Bible and he asked Lemaitre to sort of justify the creation story in Genesis using these new cosmological discoveries and Lemaitre said, “No, that is a very bad idea, so what if tomorrow someone invents a new theory where the Big Bang was not the beginning of everything then we’ll be in trouble.” So he knew better than to do that whether or not you have a religious implication of it. Circa 1920s, the story seemed to be the universe had a finite age. There’s only a finite number of years between the beginning of the universe and now and now we know that number is about 14 billion years. What we don’t know is whether or not that was the beginning because it’s an implication of general relativity under the right assumptions, but general relativity might not be right.

 

General relativity doesn’t include quantum mechanics. We need a quantum theory of gravity. Maybe there are extra dimensions of space, maybe there are multidimensional brains moving in some string theory construction. Many people have proposed scenarios where the Big Bang is the beginning of our local observable region of the universe, but it’s not the beginning of the universe as a whole. So we don’t know is the answer to the question, did the universe have a beginning in general relativity. Maybe the Big Bang was the beginning. There is a theorem that is sometimes bandied about, the Borde-Guth-Vilenkin theorem.

 

Arvind Borde, Alan Guth, Alex Vilenkin, and some cosmologists in the Northeastern United States were interested in the question of, “can inflation go on forever?” Inflation is a theory wherein in the very, very early universe there was a tiny moment of time when the universe underwent a hyper fast period of accelerated expansion. So just like we discovered what our universe is doing today, back then there was this dark energy essentially that was incredibly dense, incredibly powerful, pushing the universe apart causing this thing called inflation and then inflation would end, that dark energy would convert into ordinary matter and energy and we would see that as the hot Big Bang that we know. That’s inflationary cosmology. What Guth and Vilenkin and some other people worked out is that inflation can end in some regions of the universe, but it doesn’t have to end everywhere. It can end here, but it can keep going other places.

 

So they invented what is called eternal inflation, even if inflation ended for us, somewhere else it’s still going on even today and they asked the question, “Could this be also true in the past?” Eternal inflation is eternal toward the future, but was it also eternal toward the past? So they wrote down and proved a theorem that said that according to the rules of classical spacetime, whether or not Einstein was right about how classical spacetime behaves, as long as you believe in the existence of classical spacetime, inflation cannot be eternal to the past. So there had to be a singularity back there rather than just an eternally inflating universe.

 

The large majority of references to The Borde-Guth-Vilenkin theorem are not from cosmologists or other physicists. They are in theological contexts because people are taking this as a theorem, a proof that the universe had a beginning, which is completely wrong. The Borde-Guth-Vilenkin theorem does not prove the universe had a beginning, it just proves that inflation was not eternal toward the past. It is completely compatible with the theorem that the universe bounced at some point in the past, that we live in a baby universe that came out of something else, that we live in a cyclic universe that bounces over and over again. There’s many different possibilities, all of which are eternal and completely compatible with the Borde-Guth-Vilenkin theorem.

 

So, “We don’t know” is the answer to the question, “Did the universe come into existence?” If the universe started, something started it, and it is a very natural way of thinking. It might not be true, but it’s a natural place to go in your thinking. But if it lasted forever, then that’s a less tempting place to go. But we don’t know which one is true.

 

The other thing of course is that the Borde-Guth-Vilenkin theorem refers to classical spacetime. That is to say, even if there are quantum mechanical particles in the universe, we treat the universe itself, the spacetime in which we live, the spacetime that obeys the rules of general relativity, as classical. As something that’s definitely there, there’s no uncertainty principle, there’s no superpositions or anything like that.

 

Most of us accept the obviously true fact that that’s not right. That ultimately, spacetime itself is going to be quantum mechanical, just like everything else. So what do we say when we have to combine quantum mechanics with curved spacetime? The answer there is that we don’t know. Quantum gravity is something we don’t have the answer to. In fact, quantum mechanics is something that we don’t really have the answer to. Quantum mechanics came along in it’s final form in the 1920s and it’s a very, very good theory for predicting the results of experiments. Quantum mechanics says that when you predict the results of experiments, you get a probability, not something definite. You say, “Well, there’s a 50-50 chance the spin will be clockwise or counterclockwise,” or something like that.

 

That’s very good. We can predict all these experiments. We can use it for technology. We can predict the existence of the Higgs boson, we can go and find it, we can build lasers and transistors and so forth, all based on the predictions of quantum mechanics. What we don’t have is an understanding of what quantum mechanics really says.

 

So we can say, “When I look at an electron that is spinning and I measure its spin, I’ll measure it to be spinning clockwise or counterclockwise with a certain probability.” But if someone says, “Well, what do you mean by measure? What exactly happens when you measure it? Is it really evolving differently depending on whether I measure it or not?” These are questions we don’t know the answer to. Not because we don’t have answers, but because we don’t agree on what the answers are. The Many-Worlds approach says there is a quantum wave function and there is nothing else, and there’s a Schrodinger equation and there is nothing else. It’s the simplest, most stripped-down version of quantum mechanics.

 

The point is that in quantum mechanics, we describe stuff not by particles, with positions and velocities, but by what’s called the wave function. We use the wave function in quantum mechanics as a tool to calculate the probability of getting various different outcomes. When you look for the location of electron, where is it gonna be, you use the wave function to calculate the probability. Some people will say that’s all it is, just a tool for calculating probabilities. So, when quantum mechanics first came along, people were interested in electrons orbiting in atoms. So you would have a wave function for an electron. You would have the very first version of this formalism that was written down by Schrodinger. Erwin Schrodinger wrote down the famous Schrodinger equation, and he was just dealing with one electron moving around the nucleus of an atom. And there, you can ask the question. Going back to our actual topic here, can things appear out of nothing? Is there a reason why things happen?

 

In the non-relativistic original Schrodinger equation, you’re just describing one electron moving in some force field of electromagnetism and electrons never come and go. In that version of quantum mechanics, that’s simple down-to-earth version. There is one electron, if you observe it, you will see it somewhere and that’s the whole story. There is no special help given to us in this question of why the universe exists. However, we know better than that. Of course, there’s more than one particle in the universe. For example, there are fields in the universe. There’s the electromagnetic field. There’s the gravitational field and so forth. Eventually physicists realized that what we thought were particles like electrons and neutrinos, quarks and so forth, everything we know as a particle is actually a vibration in some sort of quantum mechanical field.

 

So not only is there an electric field and a magnetic field, which when they vibrate give us photons when you observe them, there is a neutrino field, which when it vibrates, we see a neutrino. When there’s an electron field, and then when it vibrates, there’s an electron and so forth. So the modern best theory of the universe is called quantum field theory. Quantum field theory describes the universe as a bunch of gently jiggling fields, filling all of space surrounding you. You yourself are an interacting bundle of gently vibrating quantum fields.

 

The great thing about quantum field theory is that it can describe not only the existence of particles as we observe them, but the creation and destruction of particles. You can make particles. When we discover the Higgs Boson at the Large Hadron Collider, you don’t actually see the Higgs itself – it decays too quickly. It changes into other particles, and we see those decay products. That’s what can be described by the formalism of quantum field theory. How particles change into each other or even how particles are just created out of supposedly nothingness.

 

In the framework of quantum field theory, you can very easily imagine evolution, according to laws of physics, that starts with empty space. Space where if you’d lived there, you would look around and not see any particles and in the ordinary evolution of things, particles would come to be. This is what Frank Wilczek had in mind when he said, “Maybe nothing is unstable.” It’s not that anything can happen if you were in empty space, you don’t need to worry that suddenly particles are going to pop into existence. They happen under the right circumstances. So the subtlety here is the definition of the phrase “empty space”. When physicists talk about empty space, usually what they mean is the vacuum of a quantum mechanical theory and that’s not a machine that cleans up your room, the vacuum is just empty space.

 

In particular, it is the lowest energy state in a quantum field theory. If you imagine you have empty space that has some energy, may be zero or depending on how you define things, if you add a particle to it to construct a different state, now there’s more energy. So vacuum, the technical definition of empty space is the state of lowest energy. The thing where there’s nothing going on. But interestingly, there can be temporary lowest energy states. In other words, you can have a state that looks like it’s the lowest energy state, but secretly it can evolve. These are called false vacuum states. This is what would drive that period of inflation that we talked about. If there were a state of false vacuum that could make the universe accelerate, and then suddenly all of its energy got converted to particles, you would see particles coming into existence where there hadn’t been any particles before.

 

That is a certainly coming close to what we have in mind when we’re asking this question, “Why is there stuff in the universe than not stuff?” So if what you care about is, why is there stuff in the universe, then the answer might very well be found in the laws of physics as we understand them now, in quantum field theory in the cosmological applications to quantum field theory. That’s the kind of question we can answer. However, you might be more ambitious than that. You might want to know not just why do particles come into existence out of empty space? You might want to say, “Why does empty space come into existence?” And here’s where it gets a little bit more wild.

 

So the question is, can the universe simply be all by itself? Even if the universe has a beginning. So again, we’ve been a little bit agnostic about whether or not the Big Bang really is the beginning of the universe. But we can still ask the question whether or not the universe had a beginning. Does it need a cause? Does the universe need something outside to bring it into existence? So the physics here is that there are two very different possibilities for the universe on its largest scale description, according to the rules of quantum mechanics. Of course it’s always possible that quantum mechanics itself is wrong. Every theory of physics has a chance of being wrong. We should be open minded about that. But if a quantum mechanics is wrong, then we have no clue what’s going on. The current state of physics is there’s zero evidence that quantum mechanics is wrong in any way. So let’s go with quantum mechanics as our theory.

 

So Schrodinger’s equation is the equation we use to describe a system according to the rules of quantum mechanics and it works for literally any quantum mechanical system. There are different versions of Schrodinger’s equation for electrons, for quantum fields, for the universe itself. And what Schrodinger’s equation is, is basically the quantum replacement for Isaac Newton’s equation that say F=ma. Force is mass times acceleration. You push something, it accelerates in a certain way. The thing that Schrodinger’s equation does is, it says you give it a quantum mechanical system, here’s how it’s going to evolve.

 

And the relevant question for our present purposes, about the existence of the universe is, “What is the energy of the universe?” This might not be what you thought you were being asked, but this is what is actually very relevant. Schrodinger’s equation acts very differently depending on whether the energy of the universe is zero or non-zero. And you might think, “Well, that’s easy. I’ve been in the universe, I’ve seen some things that carry energy so I’m pretty sure the energy of the universe is not zero.” That’s a little bit too quick.

 

Of course, since we’re doing the whole universe, it’s not just the stuff in the universe that matters, but also spacetime itself, the curvature of spacetime, according to Einstein’s general relativity. And that counts when we count up the energy of the universe, and it’s very plausible. It’s not 100% sure, but in certain very, very plausible versions of cosmological physics, the energy of the universe is exactly zero. If the universe is closed, for example, if the spatial topology of the universe is like a sphere or a torus, or something like that, if the universe is finite in extent then the straightforward application of what we know about general relativity seems to imply that the energy of the universe is exactly zero. We don’t know if that’s right. It’s very easy for that straightforward marriage of general relativity and quantum mechanics to not be right.

 

It’s very possible the universe is not closed, so there are two possibilities that are very much on the table: A universe with energy, and a universe without. And they have very different implications for the question of where the universe came from. If the universe has energy that is not zero, and quantum mechanics is right, so Schrodinger’s equation is right, then it follows directly that the universe has lasted forever. Just like Newton’s equations, Schrodinger’s equation just says the universe continues forever both from minus infinity in the past, to plus infinity in the future.

 

If on the other hand, the energy of universe is exactly zero, then there is a puzzling thing that happens where there is no such thing as time. That’s a problematic thing when you’re trying to understand when the universe came to existence, if there’s actually no time itself. So, what Schrodinger’s equation says is how the universe evolves as time passes. And what it says about a universe with zero energy is that such a universe doesn’t evolve, it doesn’t change, it’s stationary. Now again, you might look around and say, “Well, I’ve been in the universe and I’ve seen things changing. Therefore that can’t be right.” But again, you need to be a little bit more clever than that.

 

People who have studied this version of the Schrodinger equation, which is sometimes called the Wheeler-DeWitt equation, after two famous physicists who studied it in the context of cosmology, a universe with zero energy and therefore no obvious time evolution can actually have sort of hidden time evolution. Just like reasons why things happen or emergent in our macroscopic world, time evolution can also be emergent in our macroscopic world. The point is you should think about what you mean when you say the time is evolving. Something is happening, and you look at a clock, and the clock says, “Oh it’s a certain time and this is what’s going on in the universe.” And then, the clock says it’s a different time, and something else is going on in the universe. And this happens on and on, an infinite number of times. That’s what we mean by time evolution.

 

Down at the level of what we actually see, time evolution is a correlation between some numbers read out on clocks and some configuration of stuff in the universe. So, in quantum mechanics, things can exist in superpositions, like that electron that we were looking at. It can exist in a superposition of spinning clockwise and spinning counterclockwise. So imagine the whole universe, a whole bunch of stuff scattered throughout space in some configuration, and a bunch of clocks reading out a bunch of different times. That’s one configuration of the universe. There’s another configuration where stuff is somewhere else, and the clocks read different things, and another configuration where the stuff is in yet a different place and the clocks read yet different things. And in quantum mechanics, the universe, the reality of it all is not any one of those but perhaps it could be a superposition of all of them.

 

So rather than, in this point of view, the universe being described as something changing through time, the universe could be a superposition of all individual moments of time in the same description. It’s very tempting to say “all at once” or “at the same time” so try to avoid those temptations. So, the universe could be all moments at once. The universe could be everything that might happen in a single unified description. And if that’s the case, then there’s no implication that the universe lasted forever. If the moments of time that are read out by a clock are emergent, are good approximations in a certain regime where we can talk about them, then the number of such moments of time might be finite. That’s the thing we would expect to be true if the Big Bang really were the beginning of the universe.

 

If time has a beginning in the straightforward sense, it’s easier to accommodate that in quantum mechanics. If the universe has zero energy, time is emergent anyway. Then you can have a First Moment of Time. Now, in either case, we have two cases on the table. One is the universe has energy and it will last forever. The other is the universe has no energy and it’s finite in time. Time is emergent. In either one of these cases, this is the punch line, pay attention. Neither one of these cases is there any implication that there needs to be something outside the universe that brings it into existence. In both cases, a universe that lasts forever, or a universe that has a beginning, a finite moment of time, the description of what is happening in the universe is completely self-contained. Its laws of physics being obeyed by everything all the time.

 

As I alluded to earlier, it’s sort of easier to see in the eternal case, where things have always existed, there’s not this implication that they sort of were created at any one moment. In the case where time itself has a beginning, that’s where you had this temptation to say, “If there’s a beginning, there’s a creation and therefore there must be a creator. There must be something outside.” Or to put it a little bit more colourfully, you say, “If you’re telling me the universe popped into existence at some moment of time, you got to tell me why it popped into existence. Things just don’t pop into existence.”

 

And the answer is, you shouldn’t say the words popped into existence. That’s not the right way of talking about it. When you say the words pop into existence, you’re already assuming that time exists. You’re assuming there’s a moment when there is no universe and then suddenly, there’s a moment when there’s not. In the scenario where the universe has a beginning, where the Big Bang is the start. There was no moment before the Big Bang. The Big Bang was just the first moment, it didn’t pop into existence. It’s just that, if you think about it, from now going backwards rather than before the universe going forwards, if you start from now and go backwards, you hit an end, and that’s it. And it makes sense in retrospect that this can happen in the case where the universe has zero energy.

 

Remember energy is conserved, in some sense. What that means is the amount of energy in the universe is the same at every moment of time. So if you’re in a universe that has energy that in some sense that universe has to exist forever. There’s nowhere for the energy to go. If there’s one moment that describes a universe with energy in it, there has to be both a succeeding moment immediately afterward, and a preceding moment immediately before. If the universe has zero energy, then time can end. Then there can be a moment and there’s no creation of anything because the total energy of the universe is zero. Nothing came into existence that always had been there before. So we don’t need a creator for the universe, according to the laws of physics.

 

Now you might want to go deeper. You might say, “Well, I’m not about the laws of physics, I’m about deep metaphysical principles. And my deep metaphysical principles include something like the Principle of Sufficient Reason. That everything that happens needs a reason.” So even if you can have physics equations that describe the universe as a self-contained system, that doesn’t explain the universe. And maybe that’s a possible way to go, but it’s not necessary.

 

The point is, as we alluded to, do there need to be reasons why things happen? What we understand from physics is that we can describe the universe, even if it has a beginning or it’s eternal in the self-contained way. We don’t need anything outside. So you do need a reason why, in that case? Well, usually the argument that you do need an external reason why is simply that a contingent universe, a universe that exists as a brute fact without any other explanation violates some cherished metaphysical principle, like the Principle of Sufficient Reason. The way to get out of it is to imagine there is a necessary being. That necessary being is usually identified with God and then God’s existence. The existence of that necessary being explains why the universe exists.

 

So then you have to explain why we should believe in a necessary being. There is a cosmological argument which is basically just a repetition of the idea that everything that happens needs to happen for a reason. If something is here, there needs to be a reason. If that thing exist, there must be a reason for that. You can’t have an infinite number of reasons. Therefore it ends in God.

 

As I’ve tried to say before, this just begs the question of whether you actually do need reasons if you’re trying to discuss whether or not things can simply be as brute facts, than starting with the assertion, “Well, we all agree that everything that happens needs a reason,” is not an effective counter strategy. There’s another famous/infamous version of getting to a necessary being, which is called the ontological argument, which goes back to Saint Anselm, and says, “We can conceive of a most perfect being.” We can conceive of something that is absolutely perfect and then it says, “The having the quality of existing is more perfect than not having the quality of existing. Therefore, if we can conceive of the most perfect being, the most perfect being must exist.”

 

No one has ever been convinced by this argument. Many people have believed that it’s true, but they already believed in the conclusion from the start. There’s many ways out of the ontological argument of this idea that we can conceive of the most perfect being. Existence is more perfect than non-existence, therefore the being must exist necessarily. A way out which is not that popular in the philosophy community is just to say, “No, we can’t conceive of the most perfect being.” You think you can, but maybe you can think you can conceive of the largest prime number, but you can’t because there isn’t any such thing. Right?

 

Maybe you think you can conceive of a circle that we can square, a circle that we can actually geometrically manipulate into a square only using compasses and straightedges. But we can’t. You can’t really conceive of that because we have theorem that no such thing exists. The point is it’s very easy to fool ourselves into thinking we can conceive of something that is just not that well defined. What do you mean by the most perfect being? Does this most perfect being hang around? Does it talk to us? Is it more perfect to talk to us than not talk to us? Is the most perfect being a male or female or is it genderless? Is it more perfect to be genderless or to be male or female? Is the most perfect being blue or is it colorless? What is most perfect? We haven’t actually defined any of these words, which is why we think we can conceive of it, but everyone’s conception might actually be different.

 

I don’t think that you can conceive of the most perfect being. I don’t think it’s a sensible concept. Therefore, even if you bought the fact that conceiving of it would necessarily imply its existence, I don’t think you’d quite get there. Anyway, that’s just a nod to the people who take the stuff very seriously, and are convinced by our arguments from the Principle of Sufficient Reason, etc, that we need more than just a self-contained description of the universe. And they might be right. But my personal landing place here is that the universe can just be. It can just be a brute fact.

 

So with that in mind, we still have a little bit to do because even though that’s the answer to the question, if the answer is why is there something rather than nothing. I think the answer is, it just is, you got to live with it. You might still ask even if you totally agreed with me, why this particular universe? Why does the universe exist in this way rather than in some other way? And that’s often what the actual discourse back and forth about why the universe exist comes down to. People are arguing about why does it have this number of dimensions, these particles, and so forth. Again, this is a question why this particular universe that may or may not have an answer.

 

Many of the world’s best physicists ask themselves, “Could the laws of physics have been otherwise?” Einstein himself is way smarter than I ever will be. Einstein wondered about this, “Could the laws of physics have been anything else?” Because I think the answer is perfectly obvious, namely, “Yes, the laws of physics could have been very different, very easily.” I’m not even sure if it’s sensible to say the laws of physics could not have been otherwise. Thinking of it in terms of Schrodinger’s equation as we talked about before, Schrodinger’s equation says, “There is a certain special thing, what in physics is called the Hamiltonian of the universe,” which is the answer to the question given some universe, how much energy does it have? That’s what makes the universe go from Schrodinger’s picture.

 

And there’s all sorts of different Hamiltonians we could imagine. There’s all sorts of different ways we can imagine, assigning different amounts of energy to stuff in the universe. So I don’t even see what the possible justification would be for arguing that the laws of physics as we know them are somehow unique. You could imagine that if the laws of physics were unique, that would be 90% of the way to explaining why the universe exists. There was only one way for it to exist. So maybe it’s at least 50% of the way. It’s either gonna exist or not. And the other 50/50 chance. But I think that the universe could have been very, very different than what we observed. So I’m not sure where that really comes from.

 

It is possible that even if the laws of physics could have been different, there is nevertheless something special about the particular laws that we have. I mean maybe the laws that underlie the universe at the most fundamental level are somehow the simplest they could be or the most elegant or beautiful or something like that. Now again, they don’t look very simple or elegant from our current point of view. There’s nice things about them that are simple and elegant, but you know, there’s all these particles. We’re not very clear on why the particles have all the different masses and couplings they do, seems to be a lot of arbitrariness in the laws of physics as we know them.

 

But maybe, that’s just our view of a very messy reality that has even deeper laws that we don’t know about, which are very simple and give rise to the messiness and apparent arbitrariness that we observe. That’s very, very possible. I think that really all we can say there is, it’s an open question. Maybe we’ll eventually find super fundamental laws of physics that are, even if they’re not the only laws of physics possible or conceivable, they’re the simplest or the best in some way yet to be defined.

 

That would not explain the question we’re after even if our laws of physics, our universe was the simplest or most elegant or beautiful. The little kid who’s our nemesis here could come along and say, “Well, why? Why should the laws of physics be so simple? Why is that?” And we wouldn’t have an answer. That would just have to be a brute fact. I also can’t get away without at least mentioning the idea that the local laws of physics that we observe, our entire observable universe tens of billions of light years across, those laws of physics might be due to what is called environmental selection.

 

We tend to think that the laws that we observe in the universe are universal by construction, but it’s possible since we only observe part of the universe that the conditions are very, very different elsewhere. And if that’s true, if conditions could be very, very different elsewhere in the unobservable universe, maybe the conditions out there just don’t give rise to intelligent creatures such as ourselves. This is of course the anthropic principle. But really it’s just environmental selection. It’s the same principle that says here in the solar system, there is not some deep existential puzzle about why life arose on earth, rather than on the sun or in between the planets.

 

There is an environment here on earth that was just way more hospitable to life coming into existence. Maybe the universe is like that. And if that’s true, we would not be at all surprised to find ourselves in the part of the universe where life can be allowed to exist. If there are many different conditions in the universe some of which support life and some of which don’t, we will see those that support life. We don’t know whether there are different parts of the universe where conditions are very different elsewhere. We also don’t know how robust life is. This is the really big puzzle, how finely tuned are the laws of physics and conditions in our local universe, for the existence of life?

 

Some people think very finely tuned. I tend to be more skeptical, more open-minded about that because I don’t know the conditions under which life could exist. There’s a novel called Dragon’s Egg by Robert Forward where he described life existing on the surface of a neutron star. If you think of life in very general term as sort of a complex system, interacting in an informationally dense way with this environment, that could happen under a whole bunch of conditions that I really don’t know anything about. Or maybe not. Maybe the necessary laws of physics are very delicate for something like that to happen. I think this is another open question where we should be humble about what we know. We don’t know the final answers here.

 

Final answers

Alright, speaking of final answers, here’s the round up. Why does the universe exist at all? Why is there something? Why is there reality rather than not reality?

 

Let me run through them very quickly.

1. God

So the most obvious one is God. This was Leibniz’s answer, why is there something rather than nothing? Because there’s a thing that doesn’t need a reason. The universe is contingent. It does need a reason. There’s something that doesn’t, a necessary creature, that’s God, that fits the role of the Principle of Sufficient Reason laid out for it. I don’t think that’s especially necessary. There’s still the question of, is it a good theory? Does God explain the universe? Does it provide an adequate helpful account of things that we observe around us? My particular answer is no. I don’t think it’s especially helpful. I don’t think it’s especially necessary.

2. Multiverse

A second possibility is what you might call a metaverse. So kind of like a multiverse, but even bigger. The point is if the difficulty in providing reason why answers is that there’s no context out of which the universe comes. For the universe, there’s no outside context. There’s no bigger picture out of which you can say, “Oh, here are the local reasons why.” So a metaverse would be a bigger picture, maybe a multiverse, but maybe even bigger than that.

3. The universe satisfies some principle

Number three is that there is some principle that the universe satisfies. That the universe is the simplest, best, most elegant, prettiest, etc. I don’t think that solves the problem. I think that number one, I don’t see any reason that it’s true. And number two, there’s still the little kid saying, “Well, why? Why should we be the best universe in any particular way?” It would provide some satisfaction to us, if that were true. It would scratch the explanatory itch, if you couldn’t really explain why we lived in the best universe possible, or most elegant, at least knowing that we did would give us some feeling that we’d accomplish something, “Oh okay, well it’s this kind of universe.” That kind of makes sense. It doesn’t really answer the question, but it provides some of the mental goal that we were trying to strive for when we asked the question in the first place. Again, I don’t see it. I don’t think it’s there, but we could find it. It’s absolutely possible in the future.

4. No option for the universe not to exist

The fourth option is the possibility that there wasn’t an option for the universe not to exist. In other words, we talked about the existence of a necessary being, and God, and so forth, but there’s another way that you could sort of slice this bread. You could say, well maybe there is simply no coherent notion of not existing. Maybe non-existence doesn’t make sense in some sense. I’m not saying I believe it but I think that at least it deserves thinking about. And the reason why I think it deserves thinking about is when you read very brilliant people talking about this question, they often use a vocabulary that doesn’t quite cohere. That doesn’t quite make sense. Derek Parfit, who is one of the great contemporary philosophers who died just last year in 2017, wrote about this question of why there is something rather than nothing very famously. And he uses phrases like, “The case where nothing would have been.” That’s how we talk. What if there were nothingness?

5. The universe just is

And finally, fifth on our list is the universe just is. You want to know why the universe is, you’re not going to get a satisfactory answer. You’re not going to be happy. The universe just is. You have to accept it. You have to learn to deal with it. There’s nothing further there.

I like this. I think it’s the one that is most courageous, most brave. It faces up to the reality of it. All of these other attempts hit this little kid problem of saying, “Well, if that’s true, why is that true? Why is that true? Why is that true?” And here you’re saying, nope. There is one level at which you just say, that’s how it is. There is nothing other than that. This is what Bertrand Russell was trying to say. I think this is probably the right answer. And I know that people don’t like it, but whether we like it or not, is not part of how we should judge a theory of why the universe is the way it is.

Conclusion

So in conclusion, maybe the universe is special. Maybe there’s something special about it that we’re going to find or on the trail of. Also, maybe it just is. I think we have to be at least open to that possibility. We don’t get to demand that the answer take a certain form because it makes us happy. That is not what we’re allowed to do as scientists, philosophers, theologians, thinkers, etc. We have to look at what the universe is doing. Try to describe it and understanding the best we can. And if the answer is, the universe is a brute fact, then that’s what we have to learn to deal with.

]]>
http://46apples.com/blog/why-does-the-universe-exist/feed/ 0
Black holes, gravitational waves, and time travel http://46apples.com/blog/black-holes-gravitational-waves-and-time-travel.html http://46apples.com/blog/black-holes-gravitational-waves-and-time-travel/#respond Sat, 12 Jan 2019 15:43:10 +0000 http://46apples.com/blog/black-holes-gravitational-waves-and-time-travel.html

In February 2016, two-and-a-half years ago, scientists announced the first direct detection of gravitational waves from elsewhere in the universe. The LIGO Observatory, the Laser Interferometric Gravitational Wave Observatory, announced that they had seen these signals of black holes 30 times the mass of the sun spiralling into each other a billion years ago, giving off gravitational waves.

 

They were actually detected back in September of 2015, and then announced in February 2016. It’s a truly groundbreaking discovery, even though it had been anticipated for years. It’s one of those things which will go down in the textbooks and in the history books as a real cornerstone of how we think about the universe.

 

These events are quite rare on a galaxy by galaxy basis. In our galaxy, the rate at which two 30 solar-mass black holes would coalesce is one in a millions years. Luckilty there are a lot of galaxies out there.

What is a gravitational wave?

A gravitational wave can be described as a ripple in the fabric or the shape of space or of space and time, that is produced, in the case of the LIGO observation, by two colliding black holes, travelling across the universe, bringing information about its source.

 

The word ripple is meant to evoke the idea of a ripple on the surface of a pond. If you throw a pebble into the pond, and it’s a very quiet pond, you see the waves propagating out. In fact, these waves are quite different, where as the surface of the pond is disturbed, it goes up and down and up and down in a wave. Here, what happens is space is stretched and then scrolls in one direction, perpendicular to the direction the wave is propagating. And then in the other perpendicular direction, it scrolls and it stretches. It’s a stretch on one direction, and a squeeze on the other.

 

What does it mean for space to be stretched, and squeezed? We could just think of particles or little tiny asteroids out there floating in space as the wave goes by, and they’re at rest with respect to each other initially, and they each ride on the stretching and squeezing space, getting pushed apart, and then together, and so on, with the distance between them changing.

 

Einstein’s opinion about whether or not these were even a real thing changed over time. There were times when he lost faith in gravitational waves, but very quickly realised that they ought to be real. But it was controversial among theorists who worked in relativity theory, at least among some fraction of the community, all the way up into the 1980s, until the physics community got it sorted out.

  • An artist's impression of gravitational waves generated by binary neutron stars.

Feynman’s thought experiment

There is a famous thought experiment by Richard Feynman, known as the Sticky bead argument, trying to show that gravitational waves are physically real.

 

Feynman’s thought experiment went as follows. Take a stick and put some beads on it. There’s a little bit of friction between the beads and the stick, and when the gravitational waves go by, they move the beads back and forth because they can slide. The stick is stiff and it resists being stretched and squeezed, so it hardly moves at all move because of its resistance. The beads don’t resist, so the beads go back and forth, rubbing on the stick, and they heat the stick up. If you have strong enough waves, they might even start a fire.

 

People hadn’t identified the right mathematical way to discuss waves until Feynman gave this beautiful description. Back in those days there was skepticism about gravitational waves, and there was arguably even more skepticism about black holes.

What is LIGO?

LIGO is a set of instruments called “gravitational wave detectors” or “gravitational wave interferometers” that are designed to detect gravitational waves coming from the distant universe and extract the information they carry; information that can be used to learn about the universe. Each of these instruments is something that measures the stretching and squeezing of space, monitors the stretching and squeezing of space, monitors the pattern of each stretch and squeeze. There are four mirrors, each of weighing about 40 kilograms. They’re perfect mirrors and they hang from overhead supports by Quartz fibres.

 

There are two mirrors along one arm of an L, and the other two along the other arm, so there are two arms that are perpendicular with mirrors at each end of an arm. These mirrors are 4 kilometres apart, and when the gravitational wave comes along, it pushes the mirrors on one arm together, while it’s pushing the ones on the other arm apart. The amount of the push and squeeze is the relevant thing, measured by laser beams. What was finally detected by LIGO was 1/100th the diameter of a proton or the nucleus of an hydrogen atom. That is roughly a trillion times smaller than the wavelength of the light that is used to make the measurement.

What the LIGO results tell us about the universe

We have learned that black holes do collide and merge, and that they do form binaries as expected, similar in neutron stars.

 

One of the most interesting things is the fact that when two black holes collide, two objects are colliding that aren’t made from matter. They have no solid surface. They have nothing solid in them at all. They’re made only from warped space and warped time. And so when they collide and merge, they create a veritable storm in the shape of space in the rate of flow of time while they’re oscillating rate of flow of time while they’re oscillating shape of space like the surface of the ocean in a huge storm out at sea. 

 

Just before the gravitational waves were discovered, solutions to Einstein’s equations on supercomputers began to tell us about these storms. We have now seen the waves from these storms. The agreement between the predictions of the simulations and the observations is absolutely remarkable. And so for the first time now, we have both a theoretical understanding and an observational verification of storms in the fabric of space and time.

 

Sticking out of each spinning black hole is a twisting vortex of space. It’s very much like the twist of a tornado, so two tornados sticking out of a black hole. One of them, at the North Pole of the black hole, it has a counterclockwise twist of space; the South Pole, a clockwise twist of space. And these vortices, when two black holes collide and merge, wind up with four vortices sticking out of a merged black hole plus two more vortices that were created by the orbital angular momentum. So you can have as many as six vortices sticking out. 

 

But black holes don’t like to have any more than two vortices, so these vortices have to fight with each other in some manner and do a shakedown to two vortices. This is very interesting behaviour of empty space.

Where does a 30 solar mass black hole come from?

The option that is most likely is that we begin with smaller black holes that form inside globular clusters, or big clusters of stars. And they sink to the bottom of the cluster through gravitational interactions with the smaller stars, with less massive stars. They sink to the bottom, they find each other, they collide and merge, and then that merged hole merges with another merged hole, that builds up fairly quickly to two 30 solar mass black holes.

 

These are very different than the supermassive black holes we have at the centres of galaxies. The ones at the centre of our own galaxy is about four million times the mass of the sun. The one at the centre of the Andromeda galaxy, the nearest big galaxy to our own, is more than 100 million times the mass of the sun. Completely different kinds of beasts.

Do wormholes exist in the real world?

Black holes really exist. Wormholes, not only are hypothetical, but the chances that they exist naturally are exceedingly small. The chances that they can be made by a very advanced civilisation, are bigger, but still small. And if they get made by an advanced civilisation, they probably implode before you can travel through them. The chances that the civilisation can stabilise them so you can travel through, again, are small, but not zero.

 

The laws of physics allow them, but unless you did something very strange with them, they would implode and self-destruct. The work that has been done points rather strongly to a conclusion that they probably can’t exist. And if they can exist they very probably can’t exist naturally.

 

Wormholes, or Einstein–Rosen bridges as they are also known, were conceived independently by Einstein and his colleague, Nathan Rosen in 1936, and previously proposed by Hermann Weyl in 1928. But it was John Wheeler who really pushed hard to understand these initially, because he believed that on very small scales, known as the plank length, the scale where space and time as we know them must become probabilistic, wormholes would fluctuate, just like everything else in the universe, due to quantum physics. On those very small scales, John Wheeler argued that you would likely find a froth of fluctuating wormholes.

 

So Einstein gives us this equation for general relativity. There’s a left-hand side which says spacetime is curved, and there’s a right-hand side which says there’s stuff in the universe, matter and energy, causing space time to curve. And the left-hand side with the curvature is very pretty and understandable, and the right-hand side with stuff is kind of a mess, which is probably why we don’t understand wormholes very well.

 

Although wormholes are things that are made from warp space time, without matter, if you have them made from warp space time without matter, then they self-destruct. You would have to put some kind of matter in them to hold them open, and that’s where it becomes tough and messy.

 

The issue Wheeler had regarding wormholes, was that when you get down to these very tiny length scales associated with quantum effects, you don’t even know the correct laws of physics at all well. And so then you have to start speculating. That’s where he gave some pretty plausible arguments that you would have this quantum foam of fluctuating wormholes. But as mentioned previously, the problem is you don’t understand the laws of physics for a big wormhole. You don’t understand the matter well enough to be sure that whether you can hold the wormhole open with it.

Using wormholes as time machines

It has been conjectured that one could use a wormhole as a sort of time machine. As mentioned earlier, a wormhole is a hypothetical object that is somewhat similar to a black hole in the sense that it has a spherical mouth, but it’s sort of like the horizon of a black hole, except you can travel two ways through this mouth. You can travel in and back out, and you go through it, and it leads to another place in the universe.

 

Perhaps, if you have a big wormhole and you can use it to travel across the galaxy very quickly, don’t you worry because special relativity says, it would be like going backward in time. Well, you can go faster than the speed of light, but not locally.

 

And the most distant part of the Universe is moving away from us faster than the speed of light, so we can’t see it ’cause light can’t get to us from it, but it’s doing it. And so what the speed limit really says is that if you have two objects that are close enough to each other that there is no significant warping of space and time between them, then they can’t move faster than the speed of light with respect to each other. But when you’ve got a wormhole, you’ve got lots of warping with space and time, and all bets are off.

 

If I wanted to use a wormhole as a time machine, I could take one mouth and I put my daughter in one mouth. She carries that mouth out through the Universe in her spaceship and comes back at high speed and time for her slows down, as seen in the external universe. And I sit on Earth, it doesn’t slow down. But as seen through the wormhole, our clocks run at the same rate. And so you begin. The clocks always running at the same rate, hers and mine as seen through the wormhole. When she comes back, she’s very young, and I’m very old, as seen through the exterior. As seen through the interior of the wormhole however, we have the same age difference as we have now. And so there’s something crazy going on. The craziness is that you have created a time machine.

 

What do the laws of physics say about this? Could we really do it? If you’re an engineer in a very advanced civilisation and you can do anything that is allowed by the laws of physics, you got to look at more than the laws of relativity. The laws of relativity say, “Sure, you can make a time machine.”

 

But you also got to look at the laws of quantum physics and the behaviour of matter. There’s always going to be some matter present because with quantum physics, there’s always at least a little bit of fluctuating matter present. Now you’ve got a wormhole you’ve turned into a time machine – relativity allowed it – what did quantum physics do? What did it say? And the answer is that quantum physics says, with high probability, that the wormhole is going to self-destruct the moment you turn it into this time machine.

 

It seems like from various different perspectives, the universe is kind of reluctant to let you build a time machine.

Conclusion

In February 2016, gravitational waves were discovered by a specially designed observatory tuned for just this purpose. These waves, predicted by Einstein, are ripples moving at the speed of light across the fabric of space-time, and are generated by severe gravitational disturbances, such as the collision of two black holes. And that’s exactly what was observed.

 

The gravitational waves of the first detection were generated by a collision of black holes in a galaxy 1.3 billion light-years away, and at a time when Earth was teeming with simple, single-celled organisms. While the ripple moved through space in all directions, Earth would, after another 800 million years, evolve complex life, including flowers and dinosaurs and flying creatures, as well as a branch of vertebrates called mammals. Among the mammals, a sub-branch would evolve frontal lobes and complex thought to accompany them. We call them primates. A single branch of these primates would develop a genetic mutation that allowed speech, and that branch—Homo sapiens—would invent agriculture and civilization and philosophy and art and science. All in the last ten thousand years.

 

Ultimately, one of its twentieth-century scientists would invent relativity out of his head, and predict the existence of gravitational waves. A century later, technology capable of seeing these waves would finally catch up with the prediction, just days before that gravity wave, which had been traveling for 1.3 billion years, washed over Earth and was detected.

]]>
http://46apples.com/blog/black-holes-gravitational-waves-and-time-travel/feed/ 0
Alan Turing – Inventing the computer, and the idea of mechanising thought http://46apples.com/blog/alan-turing-inventing-the-computer-and-the-idea-of-mechanising-thought.html http://46apples.com/blog/alan-turing-inventing-the-computer-and-the-idea-of-mechanising-thought/#respond Sun, 06 Jan 2019 14:24:00 +0000 http://46apples.com/blog/alan-turing-inventing-the-computer-and-the-idea-of-mechanising-thought.html

Hello everyone,

 

Recently I sat down to watch The Imitation Game with my daughter, who has been going through a bit of a Benedict Cumberbatch phase lately.  

 

The film is based on the biography Alan Turing: The Enigma. 

 

Like most of you perhaps, I know Alan Turing as the inventor of the computer, as well as the world’s first programmer. The story behind the man is a fascinating one, as is how he conceived of the computer through his idea about mechanising thought.

  • The Imitation Game

Who was Alan Turing?

Alan Turing became very famous as a young mathematician for realising that there were some numbers that were uncomputable, meaning literally, if you tried to mechanise thought. So in that sense he literally invented the computer, which at the time was a word for people who calculated things, but we now understand as a machine that’s able to do lots of flexible stuff.

 

These computers used to be called Universal Turing Machines, after Turing, but Turing’s idea was to imagine mechanising thought and figuring out a way in which theorems and proofs work, and in that process, he proved that there were numbers that could never be computed in a form shorter than the number itself.

 

Let’s take the number 0.123579… for example. It goes on and on for infinity. The code to generate that number is exactly as long as the number. Well, actually shorter, which is not true of the numbers two, three and four, which we can write a very short code for. But take the square root of two. The square root of two is actually an irrational number, but it is computable in a very short code.

 

So, the difference between the square root of two and these other numbers was that there was no code that could be written – no mechanised system that could be devised – that would yield the number any more quickly than just randomly tossing the die of what the next digit should be after the decimal point.

 

Okay, so that sounds very abstract, but what it means is that there are facts about numbers – simple numbers – numbers between zero and one, about which we will never know anything. Not only that, but there’s an infinite number of such numbers, and it’s the largest infinity of the numbers between zero and one. Well, most numbers actually.

 

Most numbers are numbers about which we will never know anything. This was a cutting edge revelation in a time when people were trying to recover from the wars and they’re trying to find solace and rationality. This belief that everything can be rational and noble was a real kick in the teeth at the time.

Kurt Gödel

Kurt Gödel is another fascinating character, who predates Turing, and gets it all started. So David Hilbert, the most powerful mathematician of the era at the turn of the century, calls for a proof that all true facts among the numbers can be proven to be true. He doesn’t literally mean he wants a list of an infinite number of proofs, he just wants a proof that it can be done. And everyone expects that this is true. So Gödel is the one who deals the first blow before Turing. Turing is really influenced by Gödel’s work, and Gödel shows that there are facts among the numbers that can never be proven to be true. Either the formal system is inconsistent, or there are true facts that can’t be proven, and Gödel rejected inconsistency. So either there’s a bold-faced paradox in mathematics, which he rejected, or there are facts that can’t be proven to be true, which is an opinion shared largely by other people. It would be much worse if one plus one was sometimes two and sometimes three.

 

Like Turing, Gödel was also a strange character. He was very isolated and very withdrawn and had strange ideas about the afterlife and Platonism. He really believed that mathematics was real in a physical sense. We could never draw a perfect circle, because there’s no such thing as a perfect circle in reality. But he believed that the mental experiment of a perfect circle is sufficient to prove it exists, which is quite insightful and interesting.

 

What Gödel did was construct a sentence, which basically says this true statement can never be proven. And then he translated it through a very clever cipher into a purely arithmetic statement that was just about numbers, and proved that that equation was correct, and therefore unprovable. Which is true. If it were provable it would have to be incorrect, because the statement said it’s unprovable.

 

It is possible that you could try to construct such a sentence, but you could not mathematise it, and you wouldn’t prove anything. But Gödel mathematised it perfectly. And ever since then, every mathematician who’s been trying to prove things and getting stuck is always wondering, “Is this one of the things that is not provable?” That is ultimately Gödel’s lesson; that you know it’s true because you step outside of the mathematical system and you reflect on it and you can declare it’s true.

Turing’s link to the Apple logo

Turing was convicted of homosexuality in 1952 and given hormone treatments, which left him depressed and devastated and suicidal, and is largely believed to have taken his own life. He was obsessed with Snow White, which had recently been aired and screened.

 

Apparently he bit from a poison apple, one that he dipped in cyanide. Interestingly, I have seen it mentioned on multiple web sites that the Apple Mac symbol of the half-eaten apple (the famous apple logo with the bite out of it) is a reference to Turing, because Turing invented the computer in this indirect way, by starting this idea about mechanising thought.

Conclusion

Alan Turing was a strange, but brilliant character. He was very likely autistic, openly gay (and persecuted for his homosexuality), and also contributed significantly to the war effort, turning the tide in favour of the allies by breaking codes.

 

In many respects he could also be considered the father of AI (artificial intelligence). He not only says, “I bet I could build a machine that could think as well as we do” (meaning that machines could think), but he also says “We are machines that think.”, which really makes him the father of AI. So then he becomes this sort of atheist that gives up all of this other stuff and says, “We simply are machines.”

  • Turing Apple
]]>
http://46apples.com/blog/alan-turing-inventing-the-computer-and-the-idea-of-mechanising-thought/feed/ 0
A Swift code refactor kata update http://46apples.com/blog/a-swift-code-refactor-kata-update.html http://46apples.com/blog/a-swift-code-refactor-kata-update/#respond Wed, 02 Jan 2019 14:37:38 +0000 http://46apples.com/blog/a-swift-code-refactor-kata-update.html

Hello everyone, and a very Happy New Year to you all! May it be a prosperous 2019.

 

Recently I posted an article on a code refactor kata. The post made reference to an iOS project written in Objective-C. As promised, there is now a Swift version of this kata available on both my GitHub and Bitbucket profiles. Both versions of the kata follow the exact same sequence of code refactors.

]]>
http://46apples.com/blog/a-swift-code-refactor-kata-update/feed/ 0
Books, bicycles, and blogs – Reflecting on 2018 http://46apples.com/blog/books-bicycles-and-blogs-reflecting-on-2018.html http://46apples.com/blog/books-bicycles-and-blogs-reflecting-on-2018/#respond Mon, 31 Dec 2018 10:38:00 +0000 http://46apples.com/blog/books-bicycles-and-blogs-reflecting-on-2018.html

Hello everyone,

 

As 2018 draws to a close, I find myself in the customary reflective frame of mind. As each year passes, I feel we generally seem to focus on the bad stuff instead of the good that took place in the year, always hoping for better the following year.

 

However, as I look back on the year, I feel that 2018 has actually been one of the better ones. What follows are my highlights of 2018.

Holland

I had the most incredible privilege of visiting The Netherlands in April of this year. I spent a week there in total – three days in Rotterdam, and three days in Zaamdam.

 

Rotterdam is the birthplace of my late grandfather, Teunis van Rossum (my mom’s father). My grandfather was born in Rotterdam on the 12th of January, 1926, but moved to Bloemfontein, South Africa on the 7th of August, 1952 after the devastating effects of the second world war on Holland. Growing up, I can remember how fondly he spoke of his hometown, and I always hoped that one day I would get to see the side of the world that he loved so much. I would never have thought that dream would come true, but in April it did, and it was just simply amazing. I had such an incredible time there, and hope to return in the not too distant future.

  • Theunis van Rossum
  • Theunis van Rossum
  • Theunis van Rossum
  • Theunis van Rossum
  • Theunis van Rossum
  • Theunis van Rossum

I even managed to learn a fair bit of Dutch before my visit, which served me well on my visit, and continues to do so, as I have since switched to watching mostly Dutch television, thanks to BVN (Het beste van Vlaanderen en Nederland, “The best of Flanders and the Netherlands”), which is a satellite and cable television channel providing Dutch and Flemish public-service television to viewers around the world.

Books

Reading is one of my favourite pastimes. I love to read books on Physics and Astronomy, which are subjects that fascinate me tremendously. Over the last few years I have managed to accumulate around 100 books, again, mostly on Physics and Astronomy, including Albert Einstein’s work on Relativity Theory, Isaac Newton’s Pinrcipia, and Euclid’s Elements.

 

I am often under the impression that I don’t get much time to read. Some way or another however – be it on the train to work, on holiday, or any other excuse I could come up with, I found enough time to get through the following list of books during the year.

 

Bicycles

Another passion of mine is cycling. If you know anything about me, you’ll know that cycling ranks amongst one of my favourite activities.

 

Back in 2003 I weighed just over 100kg. Then I discovered cycling. I ultimately lost nearly 30kg by the time 2004 rolled in, and by 2005 I was chosen to race for one of the top South African Vets licensed racing teams, Gims Powerade.

 

I was a roadie (slang for someone who rides on the tar roads) through and through, but always felt tempted to get a mountain bike. At the time I was racing (around 2004/5/6), a lot of my peers had acquired mountain bikes, and they would go on and on about how much fun it was. I always felt tempted to get one, but I could never justify it. In 2017 my daughter decided she wanted to do the 94.7 mountain bike race, and needed a mountain bike. I got her a Giant 29er, and rode it myself once or twice. That was all it took, and by March of this year (on my birthday in fact) I purchased a Silverback Sola 4 29er. I have since racked up 2,688km on it, and it’s been quite a ride.

 

But, as I said, I’m a roadie at heart, and for many years I have been threatening to get a new road bike. My trusted steed for many years, an Orbea with an aluminium frame, I have had since around 2007. But the miles have started to show, and sadly spares are in short supply for this bike. The headset rattles like crazy, but the bike shops can’t do anything about it, as I am told they are no longer able to obtain the spares to repair the headset. So in June of this year I started to seriously shop around for a replacement, and after much help and advice from friends, finally settled on a Specialized Tarmac SL4 Sport. It has a full carbon frame with a Shimano 105 groupset, and is simply the most amazing bicycle I have ever ridden. As of this writing, I have enjoyed 2,803km onboard it.

 

With all that said, earlier this year I set a target for myself to ride a total of 10,000km in 2018. I am very proud to announce I reached that milestone this week. It’s has truly been an amazing year on the bike.

Guns n’ Roses

Another dream came true this year when one of my favourite bands of all time decided to tour South Africa.

 

My daughter and I had the pleasure to see Guns n’ Roses in Johannesburg on Thursday, the 29th of November 2018.

 

Guns n’ Roses are truly one of my favourite bands ever! I even still have a scrapbook that I started putting together in high school (around 1988) with photos and articles on the band. And if Guns n’ Roses are one of my favourites bands, well, lead singer Axl Rose is one of my favourite singers of all time – across any genre.

 

I never thought I would ever see the day I would see them live. In fact, I was very tempted to pay a visit to my sister in Melbourne, Australia to see them last year, but it turns out I just needed “a little patience”. It was an amazing, surreal three-and-a-half hour experience, and it was everything I had ever hoped and imagined it would be.

  • Guns n Roses ticket stub

Blog

I came up with the 46Apples monicker around 2009. Since then I have posted various blogs and code projects on various online forums under the 46Apples banner.

 

The original 46Apples blog was hosted on blogspot since 2009 (and can still be reached at http://46apples.blogspot.com), but I found that the site was very isolated from the rest of my online content. What I wanted was to have a central hub for all things related to me and 46Apples, be it social media, source code, training activities, and blogging. And so this month, December 2018, I made that a reality by registering the 46Apples.com domain, and created a web site that serves mainly as the new home for my blog, and also as a springboard to the rest of my online content.

The lows

Of course there were challenging times in 2018 as well. My dad had a cycling accident in April, which landed him in ICU for a few weeks with multiple fractures and bleeding on the brain, injuries I am happy to announce he has since fully recovered from.

 

There were other moments in 2018 that were not too rosey, but as the saying goes, what doesn’t kill you makes you stronger. I think compared to the rest of the year, most of the lows were rather negligible.

Conclusion

And there you have it. All in all I feel it’s ultimately been a good year. We (as a family) have been through a few very hard years prior to this one, so perhaps that’s why it seems better in comparison. All the same, when I look back on 2018, I am happy to sign the year off with a smile :)

 

Happy holidays folks. See you soon in 2019.

]]>
http://46apples.com/blog/books-bicycles-and-blogs-reflecting-on-2018/feed/ 0
Practice what you preach – a code refactor kata http://46apples.com/blog/practice-what-you-preach-a-code-refactor-kata-2.html http://46apples.com/blog/practice-what-you-preach-a-code-refactor-kata-2/#respond Sat, 29 Dec 2018 13:48:41 +0000 http://46apples.com/blog/practice-what-you-preach-a-code-refactor-kata-2.html

Hello everyone,

 

Recently I came across an article on Michael Feathers’ blog entitled Testing Yourself – Growing Through Refactoring. The article reminded me of a kata that I had put together a while ago that includes various code refactors that I regularly use to prime my brain before I get started on my daily duties as a software developer. After reading Michael’s article, I felt inspired to share this kata with the community.

 

“What is a kata?” you may ask. Well, in karate a kata is an exercise where one repeats a form many, many times, making improvements in each iteration. In software development, the term is applied in the same sense.

 

This particular kata helps me practice various code refactors, as well as a few useful shortcuts in my IDE (Integrated Developer Environment). The starting point is a simple project called EmployeeDemo written in Objective-C, with an Employee class and an associated unit test suite, which can be downloaded from GitHub.

 

The idea behind the kata is I start off with the Employee class that exposes a single method, payAmount, and then proceed to refactor the Employee class so that adding a new employee type (a Developer in this instance), will not violate the Open / Closed principle, and enable me to add any additional employee types later without opening up the Employee class for modification again. The Open / Closed Principle forms part of the SOLID engineering principles described in my previous blog.

 

The employee types are defined according to an enum called EmployeeTypes, and initially contain three types: Engineer, Salesman, and Manager. Each employee type returns its own pay amount as per the associated unit tests.

 


I will transform the Employee class from


 

Employee before


To


 

Employee after

Notice how the ugly switch statement has disappeared from the Employee class in the latter image? This is what will make it possible to add the Developer type without opening up the Employee class again :)

 

I came across the various refactorings in Martin Fowler’s excellent book, Refactoring: Improving the Design of Existing Code. The code samples in his book are written in Java, but I have adapted them to Objective-C for my code kata. A version of this kata written in Swift will be made available soon.

 

As mentioned earlier, I have made the kata available for download on GitHub. The repository has two branches: Master is the vanilla implementation of the Employee class and its test suite, with the tests asserting the employee pay amounts are as expected. The second branch, Refactor-Kata, shows each refactor as a separate commit, each with passing unit tests. You should be able to follow the refacotrings by navigating through the individual commits on the Refactor-Kata branch.

 

What follows is an overview of each step along the refactor process.

Self Encapsulate Field

The first step is to apply the Self Encapsulate Field refactor to the type field. I am accessing the field directly in the original version of the Employee class, but the coupling to the field will become awkward when I want to introduce a separate class to handle the employee types. Getting and Setting methods are added for the field, and only those are used to access the field

 

Self-encapsulate field

Replace Type Code with State/Strategy

Next the Employee class is refactored by applying the Replace Type Code with State/Strategy. The EmployeeType class has been added as a State class that will handle the various employee type codes

 

Replace Type Code with State

 

Yes, another ugly switch statement has been introduced here, but as I will show later, there will be only one at the end, and it is only used at creation.

 

To clean up the Employee class, I next use the Factory Pattern to extract the creation of the EmployeeType derivates from the Employee class to the EmployeeType state class

 

EmployeeType Factory Pattern

 

Then I extract the payAmount logic from the Employee class to the EmployeeType state class

 

Extract payAmount - Employee

 

Extract payAmount - EmployeeType

Replace conditional with polymorphism

Now for the cool part – I get to use polymorphism :) This is the final refactor I have to do before adding the Developer type.

One by one, I comment out each leg of the switch statement in the payAmount method, which causes the tests to fail, until I override the payAmount method in the required EmployeeType derivative, and all that’s left in the payAmount method is a @throw statement. The payAmount method now uses polymorphic dispatch to determine the correct employee pay amount

 

Replace conditional with polymorphism

 

Replace conditional with polymorphism - Engineer

 

Replace conditional with polymorphism - Manager

 

Replace conditional with polymorphism - Salesman

 

Alright. Now I can do the Developer stuff. First, add the Developer type to the EmployeeTypes enum

 

Add Developer to EmployeeTypes

 

Add the test for the Developer’s pay amount

 

Add Developer test

 

Initially the new test won’t pass, but that’s fine – it’s called TDD (Test-Driven Development). We write a failing test first, then we write enough production code to make it pass.

 

To make the test pass, I need to add a new case to the EmployeeType’s factory method for the Developer type

 

Add Developer to factory

 

And add the new Developer class as a EmployeeType derivative, and override the payAmount method

 

Developer with payAmount override

 

And I’m done! All the tests pass, and I have achieved my goal of making the Employee class open for extension, but closed for modification.

 

I find this kata very useful to show how one could use polymorphism to replace an if…else or switch statement (otherwise known as a conditional), and fix an Open/Closed Principle violation.

]]>
http://46apples.com/blog/practice-what-you-preach-a-code-refactor-kata-2/feed/ 0
Could you do me a SOLID mate? http://46apples.com/blog/could-you-do-me-a-solid-mate.html http://46apples.com/blog/could-you-do-me-a-solid-mate/#respond Mon, 24 Dec 2018 10:28:26 +0000 http://46apples.com/blog/could-you-do-me-a-solid-mate.html

Wow, it’s been a while! Nearly nine years since my last blog post. A lot has changed since then – some for the better, some for the worse. I’d like to think it’s been the former for me, and what it means to be a professional software engineer nowadays. And as I embark on the next chapter in my career, I thought it apt to write a little about something that has had such a profound impact on me and the way I now look at the structure of computer source code.

 

So – clean code. Why does it matter, and why am I blogging about it? Well, as Martin Fowler once said, “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” More on Mr. Fowler in a future blog…

 

Many programmers are under the impression that if it compiles, it’s good to go, and on to the next feature. Who cares if code is not separated into logical units, or that the functions are small, or the proper boundaries have been implemented, or that the names are clear and reveal intent? As a result, the software inevitably loses its “softness” – it’s ability to change. It becomes rigid, and it takes longer and longer to implement new features due to the tangled mess.

 

I too was guilty of this many times. It’s not that I didn’t care about the code, I simply just didn’t know better, until, that is, I was introduced to SOLID. I was just as keen as the next developer to finish the feature and move onto the next thing. For example, a number of years ago I had a very popular iOS app on the app store that was a pretty good MVP (minimum viable product) that had enjoyed around seven thousand downloads! Pretty impressive, if I say so myself! Then came the time to add the next feature. To cut a long story short, this new feature (although nothing major) ultimately required way too much effort because the structure of the existing code did not allow for the new code to be written, and the app never got its new feature implemented, and ultimately disappeared off the app store as it had lost its market value without that new feature.

 

So, what is SOLID? According to the Wikipedia definition, “in object-oriented computer programming, SOLID is a mnemonic acronym for five design principles intended to make software designs more understandable, flexible and maintainable. The principles are a subset of many principles promoted by Robert C. Martin. Though they apply to any object-oriented design, the SOLID principles can also form a core philosophy for methodologies such as agile development or adaptive software development.”

 

I am thankful that I got the opportunity to learn about the SOLID principles, having experienced the benefits first-hand working on an iOS application for one of the leading banks in South Africa. Our codebase has become clean, and changes are implemented with relatively little effort due to the “soft” nature of the code.

 

But it took time. There was no smooth road to grasping all the principles. All too often others would look at some code and go “this is a clear SRP violation”, or “this violates ISP”, or “this code violates the Open / Closed principle”, and so on and so forth. But in the bigger context of the application it was sometimes hard to spot these violations, let alone find solutions to implement the code to remedy the violations. It was a bumpy ride. At the time it would have been useful to have a few concrete, bite-sized SOLID examples that I could refer to when I got stuck or was in doubt.

 

And so the idea for this article was born.

 

I have put together a very basic collection of Swift Playgrounds in a workspace (SOLID-Swift-Demo.xcworkspace) that can be found on GitHub. The playgrounds have been written in Swift 4.2.1 and XCode 10. The playgrounds are sorted according to the SOLID acronym in the workspace (01 Single Responsibility Principle, 02 Open/Closed Principle, etc.). Each principle has an associated playground page giving a brief explanation of the principle, how to recognize it in code, and the benefits of implementing it. In most instances there are two playgrounds per principle: an example of a violation of the principle, and in some cases an example of how one could fix the violation.

 

Maybe you’ve seen this type of thing on the web before. There are certainly no shortage of blogs and information on the web talking about SOLID, but the one I have posted on GitHub is the kind of thing I wish I’d had when I was first introduced to the principles.

 

For more on clean code, check out Robert C. Martin’s blog (affectionately known as Uncle Bob).

]]>
http://46apples.com/blog/could-you-do-me-a-solid-mate/feed/ 0