All right, this is actually a very old piece of imperative knowledge for computing square roots, it's attributed to Heron of Alexandria, although I believe that the Babylonians are suspected of knowing it beforehand.
好,这是一个很古老的,关于计算平方根的程序性知识,是亚历山大的海伦提出的,不过我怀疑在那之前,巴比伦人就已经猜想过了。
And now, my subway goes right from my apartment to Union Square,
现在,正好有地铁从我的公寓到这儿,
Then if I'm looking for the square root of something less than 1, I know it will be in my region, right?
如果我要求平方根的数小于,我就知道我们的答案应该,在0-1这个区间了,对不对?
So, at this place where it hits zero, 0 that means that the square of the wave function is also going to be zero, right.
它达到0的地方,这意味着波函数的,平方也是,如果我们看概率密度图。
But that's even not right here in Union Square.
但那甚至不在联合广场这边。
It's as if we're back to square one with the deep, right?
这就像一切都回到了原点?
It was over here. Because the square root of a quarter is not smaller than a quarter it's bigger than a quarter. Right?
答案超出了这个区间,因为0。25的平方根会比0。25大,是应该比0。25大对不对?
All right? I mean, I can make money at Harvard Square doing this stuff, right?
对不对?【鼓掌】我意思是,我可以在哈佛广场,靠做这个赚钱对不对?
I want to then do, I need to find the square root b squared plus h squared, right?
我接下来要求b的平方和h的平方,的和的平方根对不对?
I'm given an integer that's a perfect square, and I want to write a little piece of code that's going to find the square root of it. All right so I'm cheating a little, I know it's a perfect square, somebody's given it to me, we'll come back in a second to generalizing it, so what would the steps be that I'd use to walk through it?
完美平方数的整数,我想写一段代码来求这个数的平方根,好,我这儿有点儿作弊了,我知道这是一个完美的平方数了,他们给我的,我们后面会讲怎么产生这个数的,那么我想解决这个问题,需要什么步骤呢?
I wanted to show you that, so, first thing I'm going to do is say, all right, I know I'm going to need square root in here, so I'm going to, in fact, import math.
我们可以开始完成这个方法了,我想让你们看到完成这个方法的过程,第一件事情就是,我们在这儿需要一个求平方根的方法,实际上我将引入math包。
All right. So we have that square root NR.
好,看看这个NR求平方根方法。
5 Right. Sure. Square root of 16 is 5.
是的,那么ANS为5,AND的平方等于。
Every time you see a square bracket, put a paren in. All right?
每次你看到一个方括弧,你就得在此添加一个圆括弧,明白了吗?
应用推荐