Tuesday, August 1, 2023

Otium Cum Dignitate

Otium cum dignitate. Leisure with dignity.

Image by Anja from Pixabay

One is entitled to leisure, but it should be an activity that maintains one's sense of dignity, integrity, and self-respect. It must be something that improves oneself such as obtaining new knowledge or working on your physical self. Leisurely pursuits should be done in a manner that upholds one's values and character, avoiding indulgences that might compromise one's dignity.

Monday, July 31, 2023

On Avoiding a Climate Disaster: What I Think

We should stop messing about with fake commitments that make us feel better & actually solve the climate problem. Renewables, nuclear energy, and efficient energy storage are needed. Then, we must solve the problems on scalable carbon dioxide fixation/recycling. 

Read the book How To Avoid A Climate Disaster by Bill Gates.

After reading, you will realize that:

  • We don't need Ecosia,
  • We don't need to delete our emails,
  • We don't need to turn off our electricity,
  • We don't need to turn to veganism,
  • We don't need to save water.

Those things will not change the system. The people that advocate such are simply putting the blame on YOU, and certainly on the poorest of us. The #1 activity that humans do where the majority of the greenhouse gas come from is the manufacturing of products. So, should we blame the companies instead?

Not quite.

Everyone is to blame, but we do the things we do because it makes us happy and content with life. We don't need to be in survival mode. Instead, we need something like a global Manhattan Project where the greatest human minds come to remove carbon dioxide & drop the greenhouse gas to essentially zero or as near to zero as can be managed. We have already surpassed the 1.5°C limit, so the only route is to burn as much fossil fuel as we need to:

a) get to a new, green energy economy 

b) maintain economic development, and 

c) build breakthrough technologies that will remove CO2 on a global scale.

Thursday, July 27, 2023

Quantum Physics - Laymen Get Wild

Quantum physics is a surprisingly broad field with quite a few people working on different problems... yet when a study gets publicly released, enthusiasts and interested individuals get scooped most of the time!

Like, remember that article hypothesized in 2020 by a particle physicist that explains the existence of parallel universes based on evidence found in a NASA experiment in Antarctica? Daily Mail, NY Post, and other non-science journalism sites went wild and people just accepted the hypothesis to be true! Of course, it's been debunked already, but it was a fun week.

Anyway, what I'm trying to say is that there's great demand for these kinds of studies. It's obvious because Marvel movies rely on these concepts as plot devices. I'm betting that Marvel Studios would start funding quantum physics research once they've used up the studies published in the 20th Century hahahaha

Nice ra sad ang The Marvels, at least in the trailer. Quantum entanglement this time 😂

Wednesday, June 21, 2023

Subtracting Numbers Without Borrowing

For my first post in a long while (6 years), I will be sharing an interesting bit from a book by Charles Petzold called Code: The Hidden Language of Computer Hardware and Software. I taught this trick to my nephew some years ago when we were out eating at Pepper Lunch in Ayala Center Cebu. Either it was the fact that I taught this to him using a piece of tissue paper (which may seem like I was introducing a colleague that I had a breakthrough in quantum mechanics) or the interestingness of the concept that really made him excited. I don't know. I just wanted to teach this one, and now you're next.

In this blog, we will be tackling one section in the book in Chapter 13 which talked about subtraction sans the concept of borrowing. People may call this "subtraction by addition." One interesting fact about this is that this method was commonly used in mechanical calculators, and is still used in some modern computers to save up on memory and increase the speed of calculations (These are mostly used by computers that require precise and quick memory processing such as those used in medicine, aeronautics, and surveillance for Google services to harvest your personal data). If you know how to add and subtract, and have familiarized yourself with basic arithmetic necromancies, then this will be easy for you. Let's dive into it so we can get a better look.

Hitting the Books: A Review on Subtraction

Here's a typical structure of a subtraction operation.


Now, we know that in Mathematics, when performing subtraction, there are three variables involved: the minuend, the subtrahend, and the difference.
  1. Minuend: The minuend is the number from which another number is to be subtracted. It is the number from which the subtrahend is taken. For example, in the subtraction problem 9 - 5 = ?, the minuend is 9.
  2. Subtrahend: The subtrahend is the number that is to be subtracted from the minuend. Continuing with the previous example, in the subtraction problem 9 - 5 = ?, the subtrahend is 5.
  3. Difference: The difference is the result of subtracting the subtrahend from the minuend. It is the answer or the numerical value that remains after the subtraction operation. In the example 9 - 5 = ?, the difference is 4, as 9 minus 5 equals 4.
To put ourselves in context so we can see this operation in action with larger numbers, let's proceed to assign 3-digit numerical values to our variables.

The Beta Way

If you have been listening to your teachers and absorbing what they taught you without understanding the concept behind it, then you're a Beta learner. Nothing wrong with that. It's pretty much the least hassle way of achieving a decent grade in class.

"Di nato dapat libugon atong kaugalingon kay daghan na kaayo'g problema sa kinabuhi."

Perhaps all of us have thought of that saying, but we need to realize that this type of mindset is only good for the short run. By ensuring that we have understood the fundamentals of the lessons we are studying, we would have built a strong foundation that may pave the way for understanding higher-level concepts. But anyway, I digress. Let's go back to the topic at hand.

Let's plug in our desired numbers for our variables in the operation. What I'm desiring right now is 489 subtracted from 653, so let's plug those in. While we're at it (and also because I'm too lazy to insert another image), we should also get the difference.


I'm sure that, according to conventions, the first thing to do is focus on the first column at the rightmost. We know that 3 (in minuend) is smaller than 9 (in subtrahend), so our first step involves borrowing from the adjacent digit. In this case, our 3 borrows from the digit 5, resulting in 3 becoming 13. Subtracting 9 from 13 yields 4, which represents the value of our difference's first digit from the right. Moving to the middle column, we need to consider the previous borrowing from 5, so 5 is actually a 4. Same concept: we borrow from the digit left to 4, so 6 becomes 5, and 4 becomes 14. We then subtract 14 from 8 to get 6. For the final digit, our 6 has become 5, and by subtracting this from 4, we get a 1. With all that, we get a difference of 164.

This is the way we have all been taught in elementary school, but we're not here for that. So now, let me introduce you to the Sigma Way.

The Sigma Way

I may call this the Sigma Way, but it's really not. It's pretty much because computers don't know the concept of borrowing values. If you think about it, there's no mathematical proof that explains borrowing. We just know that it's a neat trick for easier subtraction. Now, you might be asking how mathematicians and computer scientists got computers to subtract values without borrowing. Well, through their smarts and cunningness, they simply used the method of complements. For decimal (base 10) numbers, we use the nines' complement. For binary, we use the ones' complement. For this blog, let's just focus on using the nines' complement since decimal numbers are generally used by people. You may look up the process of ones' complement after reading this post.

For this example, let's reuse what we had in the previous section.


While we already know the difference between the two values, let's still try to perform the operation. This time, let's use the nines' complement to get the difference between the two numbers.
  • Step 1: Get the nines' complement by subtracting the value of our subtrahend from 999.


  • Step 2: Add the difference value of Step 1 to our minuend.


  • Step 3: Add 1 to our sum from Step 2.


  • Step 4: Subtract 1000 from the sum from Step 3.


Not only will you have noticed that no borrowing occurred in all four steps, but also that what we have in Step 4 is exactly the same as what we had through borrowing as showcased in the previous section. Why does this work? Unlike in the concept of borrowing, the use of the nines' complement offers an elegant mathematical process. The image below gives a step-by-step visualization of the process:


Hopefully, the image provided is self-explanatory enough to warrant no explanation. If not, you may leave a comment because I'm too lazy to explain it here (But I recommend doing so only after you've read the rest of the blog). At least I would know if people actually read my posts. Now you could be asking, "How about when we want to subtract two 4-digit numbers?"

Then, instead of adding both sides by 1000, we simply add 10000. Afterward, we break the positive 10000 down to 9999 and 1. Other phases of the process will still be the same. While we're here, I should also mention a case with varying numbers of digits. For example, 782 subtracted from 4001:


The first thought some of you might come up with is to subtract 782 from 9999 since we have a 4-digit number on our hands. But it's actually 999. The number of digits of 9's should be equal to the subtrahend's number of digits since the complement we're looking for is only for the subtrahend.
  • Step 1: Get the nines' complement of our subtrahend.


  • Step 2: Add our nines' complement to our minuend.


  • Step 3: Add 1 to our sum.


  • Step 4: Subtract 1000 from our sum.


Another case I want to discuss is an operation yielding a negative difference. For example, 5481 is subtracted from 4263. The process here is slightly different as it is a special case. Two things will depend if an end carry* occurred when you added the subtrahend's complement and minuend. If it has no end carry, then the complement of the sum of the subtrahend's complement and minuend is obtained and the negative sign is added.


*This is the carry that happens for the digits at the leftmost column when you add two numbers together resulting in an increase in the number of digits to the left. For example, when you add 85 and 20, the end carry happens at 8 and 2 giving us a sum containing a digit at the hundred's place.

  • Step 1: Take the 9's complement of subtrahend.


  • Step 2: Add the 9's complement to the minuend.


  • Step 3: Because there is no end carry that occurred when we added the subtrahend's 9's complement and minuend (Step 2), we must obtain the sum's 9's complement.


  • Step 4: Because there is no end carry that occurred when we added the subtrahend's 9's complement and minuend (Step 2), we have determined that the difference is negative.


...and that's all there is to it! 😉👌

Final Words

Congratulations! You have successfully graduated from being a Beta. Now onwards with the way of a Sigma in subtracting numbers, and flex your skills at parties and other social gatherings.

YOU:



If the subject of this blog interested you in any way, please try reading the full book by Charles Petzold. It's a really interesting read, and it works as a good introductory book for those looking into how computers work systematically. I haven't finished it yet because I needed to focus on my school works, but I hope you will.

Although I could have included more content in this post, I must admit that laziness got the better of me. Plus, I think the post ended up being longer than I anticipated. Anyway, I'm no expert on this topic, but  I'll make an effort to provide the best possible answers to any questions that may arise in the comments. Feel free to raise them!

Thank you for reading. Avante!