# 台灣人工智慧學校新竹分校第一期技術領袖培訓班資格考試考古題
參考解答會在選項前以星號(*)標記,不過目前並不保證一定正確,各位高手可以自行編輯(需登入)更正答案或提供各題詳解。
感謝一同討論解題的各位: **Paul, 陳彥吉, 游聲峰Robert, Sean, Moony Hsieh, johnson, 怡中**
## Calculus
1. Let the function $f(x)=ax^3+bx^2+cx+d$. Suppose that $f(0)=4$ is a critical point of $f$ and $f(1)=-2$ is a point of inflection, find $a$, $b$, $c$ and $d$.
Hint: The critical point of $f$ is the point such that $f'(x)=0$, and the point of inflection of $f$ satify $f''(x)=0$.
($A$) $a=1$, $b=5$, $c=8$, $d=6$
($B$) $a=13$, $b=-3$, $c=-5$, $d=4$
*($C$) $a=3$, $b=-9$, $c=0$, $d=4$
($D$) $a=6$, $b=11$, $c=1$, $d=-2$
>$f(x)=ax^3+bx^2+cx+d$
$f'(x)=3ax^2+2bx+c$
$f''(x)=6ax+2b$
>Then solve:
>$f(0)=d=4$...(1)
$f(1)=a+b+c+d=-2$...(2)
$f'(0)=c=0$...(3)
$f''(1)=6a+2b=0$...(4)
2. Find the $(x,y)\in\{(x,y)|2x^2-y^2=1\}$ which minimizes the distance from $(3,0)$, and what is the minimal distance $d$?
($A$) $(x,y)=(3,\pm4)$, $d=2$
($B$) $(x,y)=(8,17)$, $d=23$
($C$) $(x,y)=(3,0)$, $d=\sqrt{3}$
*($D$) $(x,y)=(3,\pm1)$, $d=\sqrt{5}$
>The points given in (A)(B)\(C\) doesn't meet the equation.
3. Find the equation of the tangent line to $y=2^x$ at $(1,2)$
*($A$) $y=x\ln{4}-\ln{4}+2$
($B$) $y=8x\exp^x-4x+3$
($C$) $y=-\sqrt[3]{x}+1$
($D$) $y=\ln{6^x}+9x$
>Only the equation listed in (A) is a linear equation
4. Let $f(x,y)=sin(x^2-y)$, find $\dfrac{\partial^2 f(2,4)}{\partial x \partial y}$
($A$) 5 ($B$) 9 ($C$) 4 *($D$) 0
>$\dfrac{\partial^2 f(2,4)}{\partial x \partial y}=\sin (x^2-y)*2x=0$
5. Let $z=f(x-y,y-x)$, what is $\dfrac{\partial z}{\partial x}+\dfrac{\partial z}{\partial y}$?
($A$) 1 *($B$) 0 ($C$) 6 ($D$) 2
>Always results in pairs of postive and negative terms that have same values.
## Linear Algebra
6. Let $A=\begin{bmatrix}
1 & 2 & 1 \\
0 & 1 & 2\\
1 & 3 & 2
\end{bmatrix}$, find a matrix $B$ such that $AB=A^2+2A$
($A$) $\begin{bmatrix}
3 & 2 & 1 \\
0 & 7 & 2\\
1 & 1 & 6
\end{bmatrix}$* ($B$) $\begin{bmatrix}
3 & 2 & 1 \\
0 & 3 & 2\\
1 & 3 & 4
\end{bmatrix}$ ($C$) $\begin{bmatrix}
3 & 7 & 8 \\
3 & 3 & 7\\
13 & 5 & 4
\end{bmatrix}$ ($D$) $\begin{bmatrix}
9 & 2 & 1 \\
7 & 2 & 4\\
6 & 3 & 6
\end{bmatrix}$
>$B=A^{-1}(A^2+2A)=A+2I$
where $I$ denotes the [identity matrix](https://en.wikipedia.org/wiki/Identity_matrix).
7. What is the rank of $\begin{bmatrix}
1 & 2 & 3 & 4 & 5 \\
1 & 0 & 0 & 1 & 0 \\
1 & 1 & 1 & 1 & 1 \\
2 & 2 & 3 & 5 & 5 \\
5 & 5 & 7 & 11 & 11 \\
\end{bmatrix}$?
($A$) 5 ($B$) 6 ($C$) 2 *($D$) 3
>Please checkout the [definition of rank](https://en.wikipedia.org/wiki/Rank_(linear_algebra))
8. Find the eigenvalues of the following matrix $\begin{bmatrix}
1 & 1 & 2 & 2 \\
1 & 1 & 2 & 2 \\
2 & 2 & 1 & 1 \\
2 & 2 & 1 & 1 \\
\end{bmatrix}$?
Hint: Try Gaussian elimination first.
($A$) 0,1,-6 ($B$) 3,5,-10 *($C$) 0,6,-2 ($D$) 0,6,12
9. Find the solution set for the following linear matrix equation
$Ax=\begin{bmatrix}
1 & 0 & 1 & 0 \\
2 & 2 & 0 & 3 \\
0 & 4 & -4 & 5 \\
\end{bmatrix}\begin{bmatrix}
x_1 \\ x_2 \\ x_3 \\ x_4 \\
\end{bmatrix}=\begin{bmatrix}
2 \\ 1 \\ 7
\end{bmatrix}$
*($A$) $\begin{Bmatrix} \left.
\begin{bmatrix}
-t+2 \\ t-3 \\ t \\ 1 \\
\end{bmatrix} \right\rvert t\in F
\end{Bmatrix}$ ($B$) $\begin{Bmatrix} \left.
\begin{bmatrix}
t+2 \\ 10t \\ t \\ 3t+1 \\
\end{bmatrix} \right\rvert t\in F
\end{Bmatrix}$ ($C$) $\begin{Bmatrix} \left.
\begin{bmatrix}
t \\ 3t \\ -t-10 \\ 1 \\
\end{bmatrix} \right\rvert t\in F
\end{Bmatrix}$
($D$) $\begin{Bmatrix} \left.
\begin{bmatrix}
3t \\ t \\ t+10 \\ 5 \\
\end{bmatrix} \right\rvert t\in F
\end{Bmatrix}$
10. For which $x$ is $A=LU$ decomposiition impossible?
$A=\begin{bmatrix}
1 & 2 & 0 \\
3 & x & 1 \\
0 & 1 & 1 \\
\end{bmatrix}$
*($A$) $x=6$ ($B$) $x=4$ ($C$) $x=12$ ($D$) $x=0$
>If $A$ is invertible, then it admits an LU factorization if and only if all its leading principal minors are nonzero.
## Statistics & Probability
11. Which of the following statements are true?
I. Qualitative variables could be multiplied.
II. Categorical variables could be continuous variables.
III. Quantitative variables could be discrete variables.
($A$) I only ($B$) II only ($C$) III only ($D$) I and II *($E$) I and III
12. Assume that $P(A)=0.4$ and $P(B)=0.3$, and $P(A$ or $B)=0.7$, $P(A)*P(B)=0.12$. Which of following statements are true?
I. $A$ and $B$ are mutually exclusive
II. $P(A$ and $B)=0.7$
III. $A$ and $B$ are independent event
($A$) I only ($B$) II only ($C$) III only ($D$) I and II *($E$) I and III
13. A variable follow normal distribution. It has a mean value of $80$ and a standard deviation of $15$. If a z-score is $2$, what's value on the normal distribution?
($A$) 68 ($B$) 95 ($C$) 99 *($D$) 110 ($E$) 125
14. A distribution that skewness value above $2.5$ ($SK>2.5$), whicch of following statements are true?
*($A$) mean > median > mode
($B$) mode > mean > median
($C$) mode > median > mean
($D$) mean = median = mode
($E$) none above
15. Assuming $P(A1)=0.3$, $P(A2)=0.7$, $P(B\vert A1)=0.2$, and $P(B\vert A2)=0.4$, $\{A1,A2\}$ is a partition of $U$, then $P(A1\vert B)$?
($A$) 0.111 *($B$) 0.177 ($C$) 0.272 ($D$) 0.323 ($E$) 0.37
16. Assume that $X$ is a random variable and its $E(X)=100$ and $\sigma^2(X)=10$. The variable $Y$ is a linear function of $X$, $Y=2X+50$. That $E(Y)$ and $\sigma^2(Y)$, which of following statements are true?
I. $E(Y)=100$
II. $E(Y)=200$
III. $\sigma^2(Y)=10$
IV. $\sigma^2(Y)=40$
($A$) I only ($B$) II only ($C$) III only *($D$) IV only ($E$) none above
16. In each case state whether you expect the two variables $x$ and $y$ indicated to have positive, negative, or zero correlation. Which of following statements is negative?
($A$) The number $x$ of pafes in a book and the age $y$ of the author.
($B$) The number $x$ of pafes in a book and the age $y$ of the intended reader.
*($C$) The weight $x$ of an automobile and the fuel economy $y$ in miles per gallon.
($D$) The weight $x$ of an automobile and the reading $y$ on its odometer.
($E$) The amount $x$ of a sedative a person took an hour ago and the time $y$ it takes him to respond to a stimulus.
18. As the figure, which of following staements are true?
![](https://i.imgur.com/ysgPUoh.png)
($A$) Set I. SSE < Set II. SSE (SSE: sum of the squared errors)
($B$) A random pattern of residuals supports a linear model.
*($C$) $y=\beta_1x+\beta_2$, Set I. $r^2=0$ and Set II. $r^2>0$
($D$) $y=\beta_1x+\beta_2$, Set I. $r^2<0$ and Set II. $r^2=0$
($E$) none above.
19. A sample of size $n=150$ has mean $x=30$ and standard deviation $s=3$. Without knowing anything else about the sample, what can be said about the number of observations that lie in the interval $(24,36)$
*($A$) At least 75%
($B$) At least 85%
($C$) At least 90%
($D$) At least 95%
($E$) none above
>$s^2=\frac{n(1-p)*(2s)^2}{n}$
$1=(1-p)*4$
$p=75\%$
20. Which following table is a valid probability distribution of a discrete random variable?
($A$)
x | -2 | 0 | 2 | 4 | 6
--- | --- | --- |--- | --- | ---
P(x)| 0.2 | 0.5 |0.2 | 0.1 | 0.1
($B$)
x | 0 | 1 | 2 | 3 | 4
--- | --- | --- |--- | --- | ---
P(x)| 0.2 | 0.2 |0.2 | 0.1 | 0.1
($C$)
x | 0.5 | 0.25| 0.3| 0.4 | 0.7
--- | --- | --- |--- | --- | ---
P(x)| 0.2 | -0.3|0.2 |-0.1 | 0.1
*($D$)
x | -1 | 0 | 1 | 3 | 5
--- | --- | --- |--- | --- | ---
P(x)| 0.2 | 0.3 |0.2 | 0.2 | 0.1
($E$) none above
## Programming
本部份共有兩大題(合計三小題),每題依序為6分,8分,6,分,合計20分。程式題請使用偽代碼(pseudocode) 作答。
Pseudocode is a simple way of writing programming code in English. Pseudocode is not actual programming language. It uses short phrases to write code for programs before you actually create it in a specific language. The purpose of using pseudocode is that it is easier for people to understand the logic behind the algorithms.
・ Rules for pseudo code, Write only one statement per line
・ Available keywords: IF, ELSE, ENDIF, WHILE, ENDWHILE, REPEAT, UNTIL, FUNCTION, FOR, PRINT, LENGTH
example 1:
```
function example1(x){
y<-"hello, ";
print(y,x);
}
X <- "AI";
example1(X);
```
The output of example 1: hello, AI
example 2:
```
function example2(n){
var y[n];
for (i from 0 to n-1){
y[i] <- i+1;
}
return y;
}
a <- 0;
while(a<4){
a <- a+1;
if(a != 2)
print(example2(a));
print(",");
}
```
The output of example 2: [1],[1,2,3],[1,2,3,4]
1. Define a function which satisfies the following requirement.
Given an integer $N \geq 1$, please return all integers $X$, betwenn $1$ and $N$, which are indivisible by 5. For example, input fun(6) and get the output $1,2,3,4,6$.
參考解答:
```
function func(n) {
var y[n-n/5];
var c = 1;
var i = 0;
while ( i < n-n/5-1){
if (c%5 != 0) {
y[i] = c;
}
}
return y;
}
```
2. (1) Write down the output of the following codes.
```
function func1(x,i,j) {
var a;
a <- x[i];
x[i] <- x[j];
x[j] <- a;
}
function func2(data) {
var i, j;
for (i from 0 to length(data)-1){
for (j from 0 to length(data)-1-i){
if (data[j] > data[j+1])
func1(data, j, j+1);
}
}
}
```
參考解答: [1, 1, 5, 6, 8, 9, 13, 22]
>Please check [Bubble sort](https://en.wikipedia.org/wiki/Bubble_sort).
(2) Define a function which satisfies the following staement.
Given $\{x_n\}$, a list of unsorted numbers, return the sum of the first quartile $Q1$ and the third quartile $Q3$.
Hints:
$$ Q_x=
\left\{
\begin{array}{l}
a_{z+1} & \text{if } z+1>\dfrac{n*x}{4}>z\\
\dfrac{a_{z}+a_{z+1}}{2} & \text{if } \dfrac{n*x}{4}=z
\end{array}
\right .
$$
1. $z$ is an integer
2. $n$ is the length of given list of numbers
3. $\{a_n\}$ is the sorted list of $\{x_n\}$
參考解答:
```
function swap(x,i,j) {
var a;
a <- x[i];
x[i] <- x[j];
x[j] <- a;
}
function sort(data) {
var i, j;
for (i from 0 to length(data)-1){
for (j from 0 to length(data)-1-i){
if (data[j] > data[j+1])
func1(data, j, j+1);
}
}
}
function func(data) {
var len = length(data);
var x[len] = sort(data);
var q1, q3;
if (len%4 == 0) {
q1 = (x[len/4-1] + x[len/4])/2;
q3 = (x[(len*3)/4-1] + x[(len*3)%4])/2;
}
else{
q1 = x[len/4] ;
q3 = x[(len*3)/4] ;
}
return q1+q3;
}
```