0%

1020 Tree Traversals (25 分)

Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the corresponding binary tree.

阅读全文 »

判断一元函数

假设需要判别的点为(0)。

连续?

左右极限相等且等于函数值。

可导?

左右导数(利用定义计算)存在且相等。

可微?

与可导相同。

判断多元函数

假设需要判别的点为(0,0)。

连续?

\(lim_{x\to 0,y\to 0}\)存在且等于函数值,那么在该点连续。 证明:使用夹逼定理等,一定要证明在所有方向上都极限存在。 反例:在某个特定的方向上极限不存在或不等。

可偏导?

对于x,y,求 \(\lim_{x\to0}\frac{f(x,0)-f(0,0)}{x}\)\(\lim_{y\to0}\frac{f(0,y)-f(0,0)}{y}\)。若极限存在,则在该方向可偏导。

可微?

\(\rho=\sqrt{x^2+y^2}\)\(\Delta z=f(x,y)-f(0,0)\)\(\lim_{\rho\to0}\frac{\Delta z-xf'_x(0,0)-yf'_y(0,0)}{\rho}\),若极限存在且等于0,则可微。(否则不可微)

已知曲线(直线)方程,求绕某一轴旋转曲面

曲线L: \(\begin{cases} 4x^2+9y^2=25 \\ z=0 \end{cases}\),求绕y轴旋转一圈的方程。

因为绕y轴旋转,因此曲线上每一点对于y轴的半径的平方为 \(x^2+z^2\),将 \(x^2\)\(z^2\) 用y或者常数替代形成等式,即为曲面方程。 \(\because x^2=\frac{25-9y^2}{4}, z^2=0, \therefore x^2+z^2=\frac{25-9y^2}{4}\),整理可得 \(4x^2+9y^2+4z^2=25\)
> 旋转曲面的关键是建立基于半径r的等式\((x-2)^2+y^2=r^2=(x-2)^2+y^2\),将右边的x、y用z的表达式替换,即可得到旋转曲面的方程。

求在这个曲面上某一点指向外侧的单位法向量

对该方程求微分,可得 \(8xdx+18ydy+8zdz=0\),而法向量的 \(\{x,y,z\}\)中的每个位置等于微分前面的系数,因此该法向量为:\(\{8x,18y,8z\}\),将给定的点带入即可算出法向量,再分别除以向量长度即可算出单位法向量。

已知曲线和平面方程,求切平面

已知曲面 \(z=1-x^2-y^2\),平面 \(x+y-z+3=0\),求曲面上与平面平行的切平面为_____。

设切点\((x,y,z)=(x_0,y_0,1-x_0^2+y_0^2)\),则法向量n= \(\pm(2x_0,2y_0,1)\)平行于平面法向量 \((1,1,-1)\),因此可以计算出 \((x_0,y_0,z_0)=(-\frac{1}{2},-\frac{1}{2},\frac{1}{2})\)。 则切平面方程为 \(-(x+\frac{1}{2})-(y+\frac{1}{2})+(z-\frac{1}{2})=0\)

求曲线在点的切线方程

求切向量和切线:曲线由两个方程构成,分别求两个方程在点的法向量,叉乘即可得到直线方向向量,利用给的点,即可算出切线。
求法向量:分别计算两个方程关于x、y、z的偏导,带入给定点即可算出法向量。
求法平面:根据切向量和切点,写出平面方程,注意平面是垂直与切向量的。

求旋转曲面在z=0和z=1之间的体积

如果求出旋转曲面是\(x^2+y^2=...z\)的形式,则对于每个\(z\)的截面为\(\pi r^2=\pi (x^2+y^2)\),则体积为\(\pi\int_0^1...zdz\)

根据偏导函数求原函数

告诉你\(f(x,y)\)满足二阶偏导、一阶偏导等于一个函数,求原函数,

\(f(x,y)\)满足\(\frac{\partial^2 x}{\partial y^2}=2\),\(f'_y(x,0)=x\),则\(f(x,y)=\)______

\(\because \frac{\partial^2 x}{\partial y^2}=2, \therefore f'_y=2y+\phi(x)\)

\(\because f'(x,0)=x,\therefore \phi(x)=x,\therefore f'_y=2y+x\)

\(\because f(x,0)=1,\therefore f(x,y)=y^2+xy+1\) 通过一个二阶偏导,还原成一阶偏导加上另一个变量的函数的形式,一层层往上推,利用所给的条件,便可以得出原函数.

计算多元函数偏导(在不知道函数具体情况下)

\(z=f(x,xy,x+y^2)\)\(\frac{\partial z}{\partial x}\)

\(\frac{\partial z}{\partial x}=f'_1+yf'_2+f'_3\) 贯彻一个思想,要求x的偏导,而\(f(x,xy,x+y^2)\)有三个位置(记为1,2,3),就是对于每个存在x的位置求导,再分别乘以该位置的东西关于x的偏导. 例如:\(z=f(a(x), b(x,y), c(y))\),\(\frac{\partial z}{\partial x}=\frac{\partial a(x)}{\partial x}f'_1+\frac{\partial b(x,y)}{\partial x}f'_2\),因为第三个位置和x没有关系,所以不求它. 如果求二阶偏导,对每个一阶偏导的地方都要再求一次每个位置的二阶偏导,而 \(f''_{12}=f''_{21}\)

已知\(f(x,y)\),求dz

\(z=z(x,y)\)\(\int_1^{x+y+z}{e^{-t^2}dt}=x^2+y^2+z\)确定,求dz

方法一:首先对x、y分别求偏导 \(\frac{\partial z}{\partial x}\)\(\frac{\partial z}{\partial y}\),而 \(dz=\frac{\partial z}{\partial x}dx+\frac{\partial z}{\partial y}dy\) 方法二:如果式子比较简单,直接对函数求关于x、y的微分。

判断多元函数在某点是否可偏导

\(f(x,y)=\sin\sqrt{x^2+y^2}\),则 \(f(x,y)\)\((0,0)\)处对x,y是否可偏导?

判断对一个变量是否可偏导,关键在于令另一个变量不变的同时,这个变量趋近于该点是极限是否存在。 \(\because \lim_{x\to0} \frac{f(x,0)-f(0,0)}{x}=\lim \frac{\sin \left|x\right| }{x}=\lim \frac{\left| x \right| }{x}\)不存在,所以对x不可偏导。 \(\because \lim_{y\to0}\frac{f(0,y)-f(0,0)}{y}=\lim \frac{\sin y^2}{y}=lim_{y\to0} \frac{y^2}{y}=0\),所以对y可偏导。

计算函数的梯度

\(f(x,y)=\arctan{\frac{x}{y} }\)在(0,1)处的梯度为____

grad\(\{x,y,z\}=\{\frac{\partial f}{\partial x},\frac{\partial f}{\partial y},\frac{\partial f}{\partial z}\}\) 对每个分量求偏导即可,前面的系数就是梯度的分量。

计算函数u沿着函数g的梯度方向的方向导数

求函数 \(u=\sqrt{x^2+y^2+z^2}\)沿 \(\frac{1}{2}x^2+yz\)的梯度方向的方向导数。

1. 计算函数的梯度,易得l={x,z,y}

  1. 梯度的方向余弦为:\(\cos \alpha=\frac{x}{\sqrt{x^2+y^2+z^2} }\)\(\cos \beta=\frac{z}{\sqrt{x^2+y^2+z^2} }\)\(\cos \gamma=\frac{y}{\sqrt{x^2+y^2+z^2} }\)

  2. 计算u的三个偏导数:\(\frac{\partial u}{\partial x}=\frac{x}{\sqrt{x^2+y^2+z^2} }\)\(\frac{\partial u}{\partial y}=\frac{y}{\sqrt{x^2+y^2+z^2} }\)\(\frac{\partial u}{\partial z}=\frac{z}{\sqrt{x^2+y^2+z^2} }\)

  3. 故方向导数为 \(\frac{\partial u}{\partial l}=\frac{\partial u}{\partial x}\cos\alpha+\frac{\partial u}{\partial y}\cos\beta+\frac{\partial u}{\partial z}\cos\gamma=\frac{x^2+2yz}{x^2+y^2+z^2}\)

方向导数相当于梯度的方向余弦与相应方向的偏导数相乘相加。

求函数间断点

函数间断点可能发生在如下情况: 1. 分母可能为0(包括指数的分母),\(\sin x\)\(\cos x\)等三角函数在分母时可能为0的\(k\pi或 \frac{k\pi}{2}\)
2. \(\tan x\)\(x=\frac{\pi}{2}+k\pi\)的时候
3. 一些隐藏的间断点,例如需要因式分解产生可能等于0的子式,三角函数恰好和子式可以同时为0(\(\frac{x+2}{\sin\pi x}=\frac{x+2}{\sin(\pi(x+2))}\sim \frac{x+2}{\pi(x+2)}\sim \frac{1}{\pi}\)), 方向导数相当于梯度的方向余弦与相应方向的偏导数相乘相加。

方向导数的最大值

方向导数的最大值相当于梯度的模。
\[\sqrt{(\frac{\partial f}{\partial x})^2+(\frac{\partial f}{\partial y})^2+(\frac{\partial f}{\partial z})^2}\]
梯度中可能含有\(x,y,z\),将坐标点代入算出即可。

全微分

\[P(x,y)dx+Q(x,y)dy\]
当题目跟你说要全微分的时候,意思是:
\[\frac{\partial P}{\partial x}=\frac{\partial Q}{\partial y}\]
\(\because P(x,y)=\frac{\partial u}{\partial x},\ Q(x,y)=\frac{\partial u}{\partial y}\therefore \frac{\partial ^2 u}{\partial x \partial y}=\frac{\partial ^2 u}{\partial y \partial x}\)

根据全微分求原函数

因为全微分的\(P(x,y)\)\(Q(x,y)\)是偏导,因此可以还原出原函数的\(x\)\(y\)部分。
\(u(x,y) = \int P(x,y) dx+\Phi(x,y)\)
\(u(x,y)'_y = \Phi'(x,y)\)

求函数在区域上的最值

首先考虑边界内:对函数的\(x\)\(y\)分别求偏导,让他们的偏导等于0,求出驻点,计算函数值。
再考虑边界上:利用拉格朗日乘数法:
设原函数:
\[u(x,y)=x^2-y^2+3\]
区域为:
\[x^2+4y^2\le 4\]
令辅助函数为:
\[F(x,y)=x^2-y^2+3=\lambda(x^2+4y^2-4)\]
分别求对\(x\)\(y\)\(\lambda\)的偏导,令它们等于0,分别求出多对\(x\)\(y\),计算他们的函数值。
综上,选择最大的为最大值,最小的为最小值。

求多元函数的极值

设函数为:
\[z=f(x,y)=x^4+y^4-4xy+5\]
1. 令函数对\(x\)\(y\)的偏导为0,求出驻点。
2. 令\(A=\frac{\partial ^2z}{\partial x^2},B=\frac{\partial ^2z}{\partial x \partial y},C=\frac{\partial ^2z}{\partial y^2}\),将一个(或多个)驻点代入分别计算。
3. 若\(AC-B^2\gt 0\)存在极值,同时若\(A\gt0\)为极小值,若\(A\lt0\)为极大值。

证明\(f(x,y)\)仅为\(\theta\)的函数

\(u=f(x,y)\)
\(\begin{cases} x=r\cos\theta\\ y=r\sin\theta \end{cases}\)
若要证明仅为\(\theta\)的函数而和 \(r\) 无关,则对 \(r\) 求偏导,若 \(\frac{\partial u}{\partial r}=0\),则\(u\)仅为\(\theta\)的函数。
证哪个有关,则证其他的偏导为0。

二元函数在区域内的最大最小值

先计算边界线上的最大最小值。
计算对于x,y的偏导,找出驻点。
\(A=\frac{\partial ^2 z}{\partial x^2},B=\frac{\partial ^2 z}{\partial x \partial y},C=\frac{\partial ^2 z}{\partial y^2}\),计算\(AC-B^2\),若大于0则为极值点,同时若A小于0则为极大值点,若A大于0则为极小值点。
将函数极值点与边界极值点相比较,找出最大值和最小值点。

1017 Queueing at Bank (25 分)

Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait in line behind the yellow line, until it is his/her turn to be served and there is a window available. It is assumed that no window can be occupied by a single customer for more than 1 hour.

Now given the arriving time T and the processing time P of each customer, you are supposed to tell the average waiting time of all the customers.

阅读全文 »

1014 Waiting in Line (30 分)

Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are:

The space inside the yellow line in front of each window is enough to contain a line with M customers. Hence when all the N lines are full, all the customers after (and including) the (NM+1)st one will have to wait in a line behind the yellow line. Each customer will choose the shortest line to wait in when crossing the yellow line. If there are two or more lines with the same length, the customer will always choose the window with the smallest number. Customer_i will take Ti minutes to have his/her transaction processed. The first N customers are assumed to be served at 8:00am. Now given the processing time of each customer, you are supposed to tell the exact time at which a customer has his/her business done.

For example, suppose that a bank has 2 windows and each window may have 2 custmers waiting inside the yellow line. There are 5 customers waiting with transactions taking 1, 2, 6, 4 and 3 minutes, respectively. At 08:00 in the morning, customer1 is served at window​1 while customer2 is served at window2. Customer3 will wait in front of window1 and customer4 will wait in front of window2. Customer​5 will wait behind the yellow line.

At 08:01, customer1 is done and customer5 enters the line in front of window​1 since that line seems shorter now. Customer2 will leave at 08:02, customer4 at 08:06, customer3 at 08:07, and finally customer5 at 08:10.

阅读全文 »

1010 Radix (25 分)

Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number.

Now for any pair of positive integers N1 and N​2, your task is to find the radix of one number while that of the other is given.

阅读全文 »