Jupyter notebook markdown tips

Tip No. 1- Tip No. 100000: play around and click every button. If you are willing to do this continuously, you will be better than half of the programmers soon, and probably can answer most of the questions in Stackoverflow related to Jupyter Notebook markdown. Go ahead, it won’t break. The worst it could happen is restart. If you have to undo, hit Esc, then ctrl + z.

More

python numpy basics | 基础 python numpy 1

Tonight our class played together numpy basics and math.  We put together a numpy basics notebook:
https://nbviewer.jupyter.org/github/magicmathmandarin/PythonBasics/blob/master/numpy_basics1.ipynb#back-to-top

Programming by trial and error is a great way for kids to learn not only programming but also math. — this should play a bigger and bigger role in children’s day to day learning.  玩编程也帮助学习算术。

Somehow I have a feeling that learning long division in this day and age is wrong.  在这个时代还学长除法那就不对了。

Go ahead and tinker with the code in the notebook. Nothing will break, we promise 🙂

tensorflow upgrade and testing | tensorflow 升级和测试

It has been over a year since I last used tensorflow. Not only library versions have changed, but also the syntax. My old jupyter notebook was throwing errors all over the place this morning. It is time to update everything.

For tensorflow, I am using Python 3.6.3 (I used to use Python 3.5), and numpy 1.16.1. TensorFlow has a few dependencies. numpy is one of them. Note the mnist dataset has 70,000 images.

python -c ‘import tensorflow as tf; print(tf.__version__)

More

The only thing that really matters is | 唯一重要的是…

We watched this very informative, entertaining and inspiring video by GitHub co-founder Tom Breston, who tricked the audience to chant on three separate occasions during this short presentation from 2012:

  • “The only thing that really matters is people 是人🙋‍♀️”
  • “The only thing that really matters is product 是产品🔨”
  • “The only thing that really matters is culture 是文化”✝.

So what is the one thing that really matters? 到底是什么呢? It is the trichotomy 三分法 of people🙋‍♀️, product🔨 and culture✝.

.

From one Tom Breston’s personal blog dated 2008, he wrote:

In the end, just as Indiana Jones could never turn down the opportunity to search for the Holy Grail, I could no less turn down the chance to work for myself on something I truly love, no matter how safe the alternative might be. When I’m old and dying, I plan to look back on my life and say “wow, that was an adventure,” not ‘wow, I sure felt safe.'”

An great collection of Python notebooks | Python 笔记本集

Here is a really great collection of Python notebooks with lots and lots of links.  We start with some appetizers:

But there are so many and so much more!  You can find them from this page:

Mathematics

    • Linear algebra with Cython. A tutorial that styles the notebook differently to show that you can produce high-quality typography online with the Notebook. By Carl Vogel.

More

Math olympia medal count analysis | 奥数奖牌分析

The International Mathematical Olympiad (IMO) is an annual six-problem mathematical olympiad for pre-college students younger than 20. The first IMO was held in Romania in 1959. As we will see, eastern Europeans were top performers in the IMO in the earlier years. You can find the summary data analysis in our Jupyter Notebook on GitHub.

It has since been held annually, except in 1980 (what happened in 1980?). More than 100 countries, representing over 90% of the world’s population, send teams of up to six students (under 20 years old) to compete.

Problems cover extremely difficult algebra, pre-calculus, and branches of mathematics not conventionally covered at school and often not at university level either, such as
– projective and complex geometry
– functional equations
– combinatorics
– number theory (where extensive knowledge of theorems is required).

No calculus is required. Supporters of not requiring calculus claim that this allows “more universality and creates an incentive to find elegant, deceptively simple-looking problems which nevertheless require a certain level of ingenuity”.

Rank Country Appearance Gold Silver Bronze Honorable_Mentions
0 1 China 32 147 33 6 0
1 2 United States 43 119 111 29 1
2 3 Russia 26 92 52 12 0
3 4 Hungary 57 81 160 95 10
4 5 Soviet Union 29 77 67 45 0
5 6 Romania 58 75 141 100 4
6 7 South Korea 30 70 67 27 7
7 8 Vietnam 41 59 109 70 1
8 9 Bulgaria 58 53 111 107 10
9 10 Germany 40 49 98 75 11

Debt | 债务

Exactly two years ago, we wrote about national debt.  It was close to $20 trillion at that time.  Now it is $22 trillion.


We are  presenting  very large numbers.

But large is only a relative term, depending on the unit we are using, and relative to what.

According to the Institute of International Finance, global debt, as of 3Q2018, is close to $244 trillion.
About one third of the debt was added in the last ten years or so. So that means that over the last ten years the total global debt grew by a half.

You can see it from the Global Debt Monitor January 2019 Report.

This probably does not mean much to you or me, unless we have some comparisons.

Visuals can help you see the numbers, but it stops short of helping us to understand the number, since money in dollars is just money in dollars unless we compare it with something.

How about we compare it with GDP (gross domestic product)? GDP in dollar is the value of all the things people produce or service for a period of time in dollar.

So debt to GDP ratio is like the amount of money you owe at the end of the year relative to the amount of money you have made over the year.   When the ratio is over 1, it means what we owe is more than what we have made in a year.

Now hopefully we can understand the ratio a little bit.

For a great narrative of history of US debt to gdp ratio, see “The Long Story of U.S. Debt, From 1790 to 2011, in 1 Little Chart” from The Atlantic by Matt Phillips.

The article was written on Nov 13, 2012. But history does not go away.

You can connect the dots to the following chart, which you can find from Federal Reserve Bank of St. Louis.  It seems that we have debt to GDP ratio getting close to historical highest level.

That was right after World War II.

So what is in the US debt?

The total US debt now is about $22 trillion.

The U.S. debt to China is $1.138 trillion as of October 2018. That’s 29 percent of the $3.9 trillion in Treasury bills, notes, and bonds held by foreign countries.

The rest of the $22 trillion national debt is owned by either the American people or by the U.S. government itself. China has the greatest amount of U.S. debt held by a foreign country.

Domestically, the total US household debt as of 4Q2018 is at $13.54 trillion (New York Fed). For a fantastic and fascinating visual account of the numbers, see the report by New York Fed.

You can find the numbers and reports easily from different federal reserve banks and government office such as the Congressional Budget Office, and the US Treasury.

These numbers, ratios and time series by component are a lot more interesting and tell a whole lot more than everyday noisy news.

What is collateral | 什么是抵押 dǐ yā

Collateral is something you use to secure money borrowed. That answer is not clear to children.

So, how about this:

If your aunt just bought a house with a mortgage (i.e. with money borrowed from a bank or some other places), if your aunt does not pay back the money borrowed, what will the lender do? The lender (for example, a bank) will take over the house and sell it to get the money back. The house is the collateral for the money borrowed.

Recall in Shakespeare’s play “The Merchant of Venice”, Antonio borrowed money from moneylender Shylock. If Antonio were unable to repay it at the specified date, Shylock would have taken a pound of Antonio’s flesh according to their agreement. Wow. That’s unthinkable in today’s world. But in 16th century, a pound of human flesh could be conceived as “collateral”.

How much money you (your parents) have borrowed relative to your collateral is called “loan-to-value”, also known as “LtV”. It is an important metric in credit risk measure.

Herstory of money-1 | 钱的历史

This is the first installment of a series of post about money, cryptocurrency and credit scoring, accompanied by Python Jupyter Notebook in our GitHub repo on credit scoring.

In this post we talk about paper money 纸币.  The reason why we keep it in the practical math category is because the herstory of money is also the herstory of math.  In God we trust and in math we trust.  God made the universe with beautiful math.

Did you know that paper money 纸币 was first used in ancient China around the 11th century 北宋朝?

Paper money was used broadly during those days due to shortage of copper and the convenience of paper money. However, the convenience combined with the unlimited power of the government to print money lead to inflation, subsequently the loss of credibility of the government, and its eventual downfall. So, even though the Northern Song dynasty had an advance monetary system, its credit failed due to long and costly wars.

Did you know that the Chinese Southern Song 南宋 dynasty government printed money in no less than six ink colors to prevent counterfeiting?

They printed notes with intricate designs and sometimes even with mixture of unique fiber in the paper to avoid counterfeiting. That was in 1107!

Backed by gold or silver too?

Isn’t it amazing that their nationwide standard currency of paper money was backed by gold or silver?! That was in between 1265 and 1274.

In the 13th century, Chinese paper money of Mongol Yuan 元 became known in Europe through the accounts of travelers, such as Marco Polo

“All these pieces of paper are, issued with as much solemnity and authority as if they were of pure gold or silver… with these pieces of paper, made as I have described, Kublai Khan causes all payments on his own account to be made; and he makes them to pass current universally over all his kingdoms and provinces and territories, and whithersoever his power and sovereignty extends… and indeed everybody takes them readily, for wheresoever a person may go throughout the Great Khan’s dominions he shall find these pieces of paper current, and shall be able to transact all sales and purchases of goods by means of them just as well as if they were coins of pure gold”
— Marco Polo, The Travels of Marco Polo

Words from XDF Founder | 俞敏洪:人生是一辈子的马拉松

人生是一辈子的马拉松

人一生有两件事不能做,一是低估自己,二是低估别人。首先不能低估自己。也许你没有优秀的资源,但无论现在社会地位如何,无论拥有的资源多少,与未来能否成功没有必然联系。与李开复相比,尽管我毕业于北京大学,但是我没有接受过西方优秀的教育,与放牛起家的牛根生相比,我似乎又是幸运的。最没有资源优势的牛根生却拥有像牛一样的精神、耐力、勇气,最后创造了蒙牛。

其次不要看低别人。很多人都会以貌取人,这是非常不对的。以我举例,上大学的时候,因为长相不够英俊,农村家庭出身,所以非常不受女生喜爱。毕业后的今天,同学聚会时我们班女生才走过来热情地握住我的手。所以我曾开玩笑的说:男人的长相与他的成就成反比,马云就是最典型的例证。

不放弃,就会出现生命的奇迹

一棵杨树10年后会变成苍天大树,但绝不会成为一颗松树。但是,人的成长是一种对不可预知的未来的渴望,成长是一种情愿在成长道路上创造奇迹的精神。我们无法预测未来,我们惟一能做的就是在成长的道路上不断前进,克服一个又一个困难,不放弃,才会出现生命的奇迹。

霍金,只有一根手指可以活动,医生曾预测他活不过20岁,但是他却活到了今天并成为世界最著名的科学家、未来学家。人生必定不是百米赛跑,人生是一辈子的马拉松,走出多少距离是我们自己来选择的。只要不放弃,就会拥有未来,就会创造生命的奇迹。
More