Blog

IBM Applied AI Courses

Hi there, it’s been a while I haven’t update this blog.

Recently, I just passed all six courses of the IBM Applied AI Certificate, and I’m being so honored to recieve these lovely certificates and badges.

This series of courses actually helps me a lot in understanding basic concepts of AI, and I can’t wait to have further study in the field of artificial intelligence.

What’s Going On

Hi, I know it has been a while since last time I update my posts. So you might wonder, what’s going on recently.

About me, recently I received my silver metal from HOSA China, some credits from Saint Louis University, and the recommendation from Mr. Ibrahim. Moreover, I just finished IGCSE and AS exams. So, from now on, I’ll have more time to spend time on dealing with this website.

Here’s some pictures.

HOSA CN 2020

Hey guys, recently, Elio, James, and I attend the HOSA CN 2020 PSA competition with Wear Mask, We Must.
Fortunately, we won the silver metal and the qualification to attend HOSA International Leadership Conference!!!
Here are our announcement and some interesting pics in HOSA CN 2020.
(PS: For some reasons, I had to attend the compeition online, so the matchstick man on the picture is basically me.)

Wear Mask, We Must

About 10 ** -n and 0.1 ** n

Normally, in mathematics, we know that 10 powered by -n equals to 0.1 powered by n.
However, in python, this equation can not stand well.

Recently, I’m working on a project, that needs the calculation of gravity between two planets. As it’s known to all, the gravitational constant G = 6.67 * 10 ^ -11. According to the formula, I write a line of code which is grav_cons = 6.67 * 0.1 ** 11. However, when I executed my code, the answer went wrong. The value of gravity in several digits after the decimal point weren’t correct.
After that, I spent serveral hours checking my code, and finally found the mistake.
In python, the answer of a calculation that contains float value will always be a float value. However, in the piece of code, the computer just automatically convert the decimal values into binaries and do the calculations. After that, the computer convert the answer in binary into the answer in decimal system and return the value, which leads to a calculation errors and effect the answer. In the end, I change the code into 10**-11, and the program finally went correct.

^ in Python

I remembered when I started to learn Python, about 1 year ago, I often get confused with ^ and **.
With my poor computer basics, I often type ^ when I was trying to explain power, and I found out the output is quite strange. Later on, I just memorized ** and never asked about ^.
Until today, I finally solved the mystery.

The Outputs When I Use ^

^ represents XFOR in python, which add two integers in binary system with limited digits.

For example, when the computer do 4^1, it first converts the two numbers into binary numbers, which are 100 and 1. Secondly, it calculate 100 + 1 = 101, which is 5.
However in the third case, when the computer add 110 + 110, the result is 000. Thats because, when the programmer inputs 6^6, the computer automatically sets the binary digits of answer into the highest binary digits of input number. As the highest digits of the input number is 3, the value of the results is out of limits, which is called overflow. In the end, computer ouput the results of 000 in binary, which is 0