Try   HackMD

台灣人工智慧學校(台北)第二期技術領袖培訓班資格考試考古題

參考解答會在選項前以星號(*)標記,不過目前並不保證一定正確,各位高手可以自行編輯(需登入)更正答案或提供各題詳解。

感謝Anio俊傑提供題目和一同討論解題的各位: Sean, Moony Hsieh, johnson, 怡中, Jacky Chang, Aellen, Yvon Wong, Victor Lin

Calculus

  1. f(w,b)=e(2w+b)
    , find
    f(w,b)w
    at
    w=1
    ,
    b=2

    (
    A
    )
    2
    (
    B
    )
    1
    (
    C
    )
    e2
    *(
    D
    )
    2
    (
    E
    )
    e1

f(w,b)w=e(2wb)(2)
f(1,2)w=e0(2)=2

  1. Estimate the extreme values (local minimum and local maximum) respectively, of the function
    f(x)=2x33x2+12x

    *(
    A
    )
    20,7
    (
    B
    )
    0,7
    (
    C
    )
    5,20
    (
    D
    )
    4,223
    (
    E
    )
    13,5

f(x)=6x26x+12=6(x+2)(x1)
extreme values occur at
x=2
or
1

f(2)=20
,
f(1)=7

  1. If
    f(y)=2y
    , where
    y(x)=x3+3x
    , find
    dfdx
    at
    x=5
    .
    (
    A
    )
    78
    (
    B
    )
    2
    (
    C
    )
    0
    (
    D
    )
    280
    *(
    E
    ) None of above

fx=x(2x3+6x)=6x2+6
f(5)x=156

  1. Suppose
    0x1
    . Find
    x
    such that
    f(x)=xlog2x(1x)log2(1x)
    is maximized.
    (
    A
    )
    0
    *(
    B
    )
    0.5
    (
    C
    )
    1
    (
    D
    )
    0.25
    (
    E
    )
    0.75

f(x)=logx1+log(1x)+1=log(1x)logx
maxima occurs at
f(x)=0
, thus
x=0.5

  1. A function
    f(x,y)=ax2+2bxy+cy2
    is built with real numbers
    a
    ,
    b
    , and
    c
    . In which conditions it will be guranteed to have a saddle point at
    (x,y)=(0,0)
    ?
    (
    A
    )
    a>0,ac>b2
    (
    B
    )
    a<0,ac>b2
    *(
    C
    )
    ac<b2
    (
    D
    )
    ac>0
    (
    E
    ) None of above

f(x,y)=ax2+2bxy+cy2
fxx=2a
,
fxy=fyx=2b
,
fyy=2c

Hessian
H(x,y)=[2a2b2b2c]

criteria for saddle point:

det(H(x,y))<0
acb2<0

Saddle point info
http://calculus.yuyumagic424.net/wp-content/uploads/2013/03/%E5%A4%9A%E8%AE%8A%E5%87%BD%E6%95%B8%E7%9A%84%E6%A5%B5%E5%80%BC.pdf

Linear Algebra

  1. For the matrices
    X=[102321]
    and
    W=[129012]
    , find the product
    (XW)T
    .
    (
    A
    )
    [12186]

    *(
    B
    )
    [11624]

    (
    C
    )
    [7974044184]

    (
    D
    )
    [7449018744]

    (
    E
    ) None of above

(XW)T=WTXT=[11624]

  1. An eigenvalue of matrix
    A
    is a scalar
    λ
    such that
    det(λIA)=0
    . Find the eigenvalues for the matrix
    A=[121610121]

    (
    A
    )
    λ=3,0,2

    (
    B
    )
    λ=3,1,4

    (
    C
    )
    λ=2,0,1

    *(
    D
    )
    λ=3,0,4

    (
    E
    )
    λ=4,1,2

det(AλI)=λ3λ2+12λ=λ(λ3)(λ+4)
λ=0,3,4

  1. For
    AX=B
    , where
    A=[1221]
    and
    B=[11127]
    , find
    X1
    .
    *(
    A
    )
    [1325]
    (
    B
    )
    [2515105]
    (
    C
    )
    [1221]
    (
    D
    )
    [5321]
    (
    E
    )
    [71121]

X1=B1A=[1325]

  1. Given two vectors
    u=(1,0,2)
    and
    v=(2,1.5,1)
    , find the
    L2
    norm (Euclidean distance)
    vu
    and the angle between them.
    (
    A
    ) distance=
    1
    , angle=
    30

    (
    B
    ) distance=
    1.5
    , angle=
    60

    (
    C
    ) distance=
    2
    , angle=
    75

    (
    D
    ) distance=
    2.5
    , angle=
    45

    *(
    E
    ) distance=
    3.5
    , angle=
    90

d=(21)2+(1.50)2+(1(2))2=3.5
θ=cos1(uv|u||v|)=cos1(0)=π2

  1. For which values of
    a
    are there no solutions, many solutions, or a unique solution to the system given below?
    x+y=1

    6x+6y=a

    (
    A
    )
    a=6
    ,
    a6
    , none
    (
    B
    )
    a6
    , none,
    a=6

    *(
    C
    )
    a6
    ,
    a=6
    , none
    (
    D
    )
    a=6
    , none,
    a6

    (
    E
    ) none,
    a6
    ,
    a=6

x+y=a/6
no solution:
a/61

infinite solutions:
a/6=1

no solution: none

Statistics & Probability

  1. Given
    P(A)=0.25
    ,
    P(B)=0.5
    ,
    P(A|B)=0.1
    , what is
    P(B|A)
    ?
    (
    A
    )
    0.16
    *(
    B
    )
    0.2
    (
    C
    )
    0.55
    (
    D
    )
    0.65
    (
    E
    )
    0.74

0.10.5/0.25=0.2

  1. Assume that
    P(A)=0.4
    and
    P(B)=0.3
    . If
    A
    and
    B
    are mutually exclusive, what is
    P(A
    or
    B)
    ?
    *(
    A
    )
    0.7
    (
    B
    )
    0.58
    (
    C
    )
    0.88
    (
    D
    )
    0.1
    (
    E
    ) None of above

0.3+0.4=0.7

  1. Suppose a random experiment has the following characteristics.
    (1) There are

    n identical and independent trials of a common procedure.
    (2) There are exactly two possible outcomes for each trial, one termed "success" and the other "failure."
    (3) The probability of success on any one trial is the same number
    q
    .
    We also say that
    X
    has a binomial distribution with parameters
    n
    and
    q
    . As we know,
    Var(X)=nq(1q)
    . Find
    E(X2)
    .
    Hint:
    E(X2)=E(Xμ+μ)2=E(Xμ)22E[(Xμ)μ]+E(μ2)=...

    (
    A
    )
    nq2+nq(n+1)

    *(
    B
    )
    nq+nq2(n1)

    (
    C
    )
    nqnq2(n1)

    (
    D
    )
    nq+nq2(n1)

    (
    E
    )
    nq2nq(n1)

  2. Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?
    *(

    A) Yes (
    B
    ) No (
    C
    )Switching or not will not change the winning probability.

Please see the introduction of Monty Hall problem or this Chinese post with illustrative example.

  1. Which of the following statements are true?
    I. All variables can be classified as quantitative or categorical variables.
    II. Categorical variables can be continuous variables.
    III. Quantitative variables can be discrete variables.
    (
    A
    ) I only (
    B
    ) II only (
    C
    ) III only (
    D
    ) I and II *(
    E
    ) I and III

According to the chart, which of the following statements are true?
16. The dotplot below shows the number of televisions owned by each family on a city block.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

*(
A
) The distribution is right-skewed with no outlier.
(
B
) The distribution is right-skewed with many outliers.
(
C
) The distribution is left-skewed with no outliers.
(
D
) The distribution is left-skewed with many outliers.
(
E
) The distribution is symmetric.

  1. A national achievement test is administered annually to 3rd graders. The test has a mean score of 80 and a standard deviation of 15. If Jane's z-score is
    1.20
    , what was her score on the test?
    *(
    A
    ) 62 (
    B
    ) 68 (
    C
    ) 85 (
    D
    ) 92 (
    E
    ) 98

z=xμσ,
1.2=x8015

x=62

  1. When we are fitting the regression model, we usually use sum of the squared error to evaluate our regression model. This number measures the goodness of fit of the line to the data. In this case, a regression model has a lower sum of the squared error and it's better model for our dataset.
Data1 Data2 Data3 Data4 Data5
x 2 2 6 8 0
y 0 1 2 3 3

Which of the models shown below is the best one, having a minimal squared error?
(

A)
y^=0.35x0.125

(
B
)
y^=0.35x+0.125

(
C
)
y^=0.65x0.45

(
D
)
y^=0.6x0.125

*(
E
)
y^=0.35x+0.55

Squared error of 5 models:
10.383125, 59.083125, 17.8125, 112.508125, 8.1725

  1. Which of the following statements are true?
    I. When the sum of the residuals is greater than zero, the dataset is nonlinear.
    II. A random pattern of residuals supports a linear model.
    III. A random pattern of residuals supports a nonlinear model.
    (

    A) I only *(
    B
    ) II only (
    C
    ) III only (
    D
    ) I and II (
    E
    ) I and III

  2. The random variable

    Z is normally distributed. Mean of
    Z
    is
    430
    , and the value
    Z=300
    is the 14th percentile of the distribution. Which is the best estimate of the standard deviation of the distribution.
    *(
    A
    ) 125 (
    B
    ) 135 (
    C
    ) 145 (
    D
    ) 155 (
    E
    ) 165

Programming

  1. Create a custom function, Derivative(), which can compute the first derivative of a given function
    f(x)
    with respect to
    x
    via Central Difference Method, defined as
    limh0f(x+h2)f(xh2)h
    .
    NOTE: Suppose the only available function is print() and let us set
    h=1.0e1
    .
# python參考程式碼
def derivative(f,x,h,order):
    if order == 0:
        return f(x)
    else:
        return (derivative(f,x+h/2,h,order-1)-derivative(f,x-h/2,h,order-1))/h
  1. A Taylor series of a function
    g(x)
    around
    x=a
    is defined by the following series expansion,
    n=0g(n)(a)n!(xa)n
    , where
    g(n)
    denotes
    nth
    derivative of
    g(x)
    . Now, given
    g(x)=2x+2x7
    , try to create a custom function, Taylor_Expansion(), to compute
    g(x=3)
    by using Taylor series (
    a=0
    ) up to
    7th
    order in
    n
    . You should find that while the answer deviates from the exact solution
    g(x=3)
    obtained from a direct substitution, the error is less than
    3%
    .
    HINT: You can take
    x=3,a=0
    and keep the summation only up to
    n=7
    in the seies formula.
    NOTE: The only available function is print() and the custom function you got in
    1.
    is useful.
def derivative(f,x,h,order):
    if order == 0:
        return f(x)
    else:
        return (derivative(f,x+h/2,h,order-1)-derivative(f,x-h/2,h,order-1))/h

def factorial(n):
    if(n<=1):
        return 1
    else:
        return factorial(n-1) * n       
        
def Taylor_Expansion(f,x,a,h,order):
    ans = 0
    for i in range(order+1):
        ans += derivative(f,a,h,i)*((x-a)**i)/factorial(i)
    return ans

def g(x):
    return 2**x+2*x**7
        
h = 0.1
x = 3
a = 0
order = 7

A = g(x)
T = Taylor_Expansion(g,x,a,h,order)

print(A)    # 4382
print(T)    # 4424.5478396