We can't actually go ahead and derive this equation of the wave function squared, because no one ever derived it, it's just an interpretation, but it's an interpretation that works essentially perfectly.
从这个方程中,导出,波函数的平方,没有人可以这样做,这仅仅是一种解释,但这种解释,能解释的很好,自从它第一次被提出来之后。
All right. I tried it on 2, I surely didn't expect a precise and exact answer to that but I got something, and if you square this, you'll find the answer kept pretty darn close to 2.
好,我试试求2的平方根,我当然不希望得到一个完全准确的答案了,但是我得到了一个近似值,试试将这个数平方一下,你会发现结果和2相当接近。
OK, once it gets to the end of that, what's it going to do? It's going to come down here and, oh. What's that doing? Well I cheated when I started. I said, somebody's giving me a perfect square, I'm looking for the square root of it. But suppose 15 I gave this thing 15, and asked it to run.
好,一旦到了循环的最后,程序会去做什么?程序会跳到这里来,噢,这是干什么的?好吧,当我开始的时候我有点小作弊的意思,我说过,我得到了一个完美的平方数,我要求这个数的平方根,但是假设下我得到的数是。
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?
完美平方数的整数,我想写一段代码来求这个数的平方根,好,我这儿有点儿作弊了,我知道这是一个完美的平方数了,他们给我的,我们后面会讲怎么产生这个数的,那么我想解决这个问题,需要什么步骤呢?
OK. If b is even, then a to the b is the same as a squared all to the b over 2.
就等于a的平方的二分之b次方,好,就是把二挪到外面来了。
I take the difference in the x-values, squared, the difference in the y-values, squared, add them up, take the square root of that.
好,是毕达哥拉斯定力对不对?,求x坐标的差,然后平方,求y坐标的差,然后平方,把它们加起来,开平方。
And keep going, until the square of one of those integers is greater than or equal to - sorry, just greater than x. OK, why am I doing that? When I get greater than x, I've gone past the place where I want to be.
如果还是比x小的话,跳到3,这么继续下去,直到一个整数的平方大于或者等于,对不起,是大于x,好,为什么我要这么做呢?,让我得到的整数的平方和。
The order complexity here, if I actually write it would be-- sorry, order n times m, and if m was equal to n, that would be order n squared, and this is quadratic.
如果m等于n的话,也就是n的平方,这是一个平方复杂度的问题,这是和前面不同类型的,好,我在做什么呢?
应用推荐