Universe of discourse
Some mathematical concepts seem straightforward, but really aren’t. E.g. addition and subtraction.
Some are almost on purpose convoluted. Consider for example the term “Universe of Discourse”. Can it get any more confusing? So many questions. What does a discourse have to do with mathematics, anyhow? And what does the Universe have to do with it?
To understand what is really meant by these words, let’s go back to their earliest use about 150 years ago.
Middle of the 19th century was a turbulent time, but not everyone was occupied by current events. Two British mathematicians – George Boole and Augustus De Morgan were busy ignoring the turmoils of their time (e.g. opium wars) and immersing themselves into deep investigations of thought and logic. Their work laid down foundations of what would become known as first-order logic, which in turn became the foundation for most computer science as we know it today.
Interestingly enough, while they would occasionally write letters to each other, they otherwise worked independently of one another to create this huge breakthrough in mathematics and yet published their findings on the same day!
Universe of Discourse was the foundation for this innovation. It started out as a simple observation. To quote George Boole: “In every discourse, whether of the mind conversing with its own thoughts, or of the individual in his intercourse with others, there is an assumed or expressed limit within which the subjects of its operation are confined.“
In other words, by discourse he means a real discussion. Actual or imaginary, and by “universe”, the range of possibilities of what the discussion is about. He is merely making an observation that when we talk about something we, of necessity, limit our conversations to a certain range of possible objects.
For example, consider the famous words of the US declaration of independence: “We hold these truths to be self-evident, that all men are created equal”. It obviously didn’t mean all men alive, rather they had to be men who were white, anglo saxon, protestant landowners.
So, there was no deep reason why Boole used the term “discourse”, just that he was making an observation about natural ways of thinking and speaking. Also, the word “universe” was simply his way of noting that it is common to limit the field of our discussion (even if such a limitation isn’t explicitly expressed).
We can see that the word “discourse” isn’t essential to the term’s definition from the fact that De Morgan (who is actually credited with coming up with the concept first) didn’t use it. He was concerned with inferences and relational algebra and simply called it “The Universe under consideration”. Making its purpose more obvious.
In fact, the word “universe” also isn’t obligatory. Later logicians have referred to the same concept as a “domain of discourse”.
Sometimes, the same concept will be simply referred to as “domain”. As in a domain of a function – which means the range of values that a function’s independent variable is allowed to take.
What, then, if anything is the actual meaning of this term?
It’s actually rather simple, it is an explicit enumeration of all possibilities for an object of a given inquiry.
In theory, this set of possibilities can be infinite, but it rarely (if ever) is. Certainly not in computer science.
In mathematics, it most often winds up being a range of values. E.g. for a function F(x) it’s the range of possible values of x.
In programming, we may encounter the universe of discourse as a datatype. Which defines a range of possible values for a given variable.
In some cases we may get to define the range. For example, while in most programming languages a string is just a string, in relational databases it can be restricted to a particular number of characters.
Some domains may be surprisingly small, for example boolean variables only allow two possible values. Some may seem incredibly large (e.g. long datatype) but are nonetheless finite.
Some programming languages allow for creation of custom types. In which case we can be true masters of the universe and create our own domains. I don’t know why custom types aren’t more used, certainly they can endow our applications with many superpowers as we can use set based calculations on narrowly defined collections of entities. This is where a lot of computational magic can happen.
So, there you have it. Despite of an awkward name, universe of discourse is a very useful concept. It is central to all of first-order logic, and by extension to all set theories, and of course to relational algebra.