參考解答會在選項前以星號(*)標記,不過目前有很多缺漏、有作答的也並不保證一定正確,各位高手可以自行編輯(需登入)更正答案或提供各題詳解。
感謝一同討論解題的各位: 怡中, 劉豐源, yogurt
Suppose we have , find .
() *() () () () None of above
Find the -coordinates for local minimum and local maximum of .
() Doesn't have one () () *() () None of above
Solved by WolframAlpha, it has only two real roots .
,
If we have , find
() () () () *() None of above
, find .
*() () () () () None of above
,
An eigenvalue of matrix is a scalr such that . Find the eigenvalues for the matrix
() () () *() () None of above
For , where and , find .
() Not invertible *() () () () None of above
,,
,,
=1-
=1-
=1-(++---+)
=1-0.3-0.3-0.2+0.14+0.12+0.1-0.08
=0.48
Nelson is studying the relationship between blood pressure and heartbeat abnormalities in his patients. He tests a random sample of his patients and notes their blood pressures (high, low, or normal) and their heartbeats (regular or irregular). He finds that: (i) 16% have high blood pressure. (ii) 20% have low blood pressure. (iii) 15% have an irregular heartbeat. (iv) Of those with an irregular heartbeat, one-third have high blood pressure. (v) Of those with normal blood pressure, one-eighth have an irregular heartbeat. Calculate the portion of the patients selected who have a regular heartbeat and low blood pressure.
() *() () () () None of above
An auto insurance company insures drivers of all ages. Jimmy compiled the following statistics on the company's insured drivers:
Age of Driver | Probability of Accident | Portion of Company's Insured Drivers |
---|---|---|
16-20 | 0.06 | 0.08 |
21-30 | 0.03 | 0.15 |
31-65 | 0.02 | 0.49 |
66-99 | 0.04 | 0.28 |
A randomly selected driver that the company insures has an accident. Calculate the probabilty that the driver was age 21-30.
() () () () *() None of above
The dotplot below shows the number of televisions owned by each family on a city block.
() The distribution is left-skewed with no outlier.
*() The distribution is right-skewed with no outliers.
() The distribution is left-skewed with many outliers.
() The distribution is right-skewed with many outliers.
() None of above
The number of injury claims per month is modeled by a random variable with , for non-negative integers, . Calculate the probability of at least two claim during a particular month, given that there have been at most four claims during that month.
() *() () () () None of above
2%*2000 = 40 (expection, 期望值)
Mutually Exclusive:
Please see the introduction of Standard Score (z-score).
There are three questions here, and each of them has a different score assign to them (6, 8, 6) with a total score of 20. The questions should be answered with 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:
1. Write one statement per line.
2. Any words after # are comments
3. Available keywords: IF, ENDIF, ELSE, WHILE, ENDWHILE, BREAK, APPEND, FUNCTION, FOR, PRINT, LENGTH, INT,
RETURN, LIST()
4. Avaliable operations: + - * / = == != <= >=
Question 1
Write a function and named it "MinMaxScaler". The function should scale a set of numbers down to a range in between 0 and 1. As the function name suggested, we will be using the min-max-scaler to complete this task (6 points total). You are given an array called "data".
Example: data = [4, 9, 3, 10, 0, 2]
1-1
Write a function and named it "Min". The function should be return the minimum value of an array (2 points).
Goal:
Input: Min(data)
Output: Minimum of data
Output for example: 0
1-2
Write a function and named it "Max". The function should be return the maximum value of an array (2 points).
Goal:
Input: Max(data)
Output: Maximum of data
Output for example: 10
1-3
Using the equation below and the two functions we just wrote to complete MinMaxScaler
(2 points).
Goal:
Input: MinMaxScaler(data)
Output: Scaled data
Output for example: [0.4, 0.9, 0.3, 1, 0, 0.2]
Question 2
Debug (8 points total): Steven was given a list of grades (called grades here) from an exam, and he intended to return another list (called status here) that indicated whether the students passed the exam or not. However he made four mistakes in his function. Rewrite the code indicated so that the function can run smoothlly (2 points each)
Append: Append is a function that insert an item to the end of a list, for example, if we have a list called T
that contains [1,2,3,4]
, then if we do T.append(6)
then the list T will be [1,2,3,4,6]
Goal:
Sample input: PassFail([20, 80, 59, 60])
Expected output: [Fail, Pass, Fail, Pass]
Line 9:
status = []
Line 12:
if (grades[start] >= 60):
Line 17:
start += 1
Line 20:
return status
Question 3
Write a function and named it MagicSquare
that determined if a matrix is a magic square or not. A magic square is a square matrix which all rows, columns, and diagonals summed up to be the same (shown below). You are given a matrix called data. (6 points total)
You can access a specific element by doing data[i][j]
where the first bracket represents the row number and the second bracket represents the column number. For example, data[1][2]
will return 1 using the square matrix above (we started counting from 0, so 1 would be the second rows/columns, 2 would be the third rows/columns).
3-1
Write a function and named it row_sum_check
, it shoud check whether all sums of the rows are equivalent or not using for loops (1 points).
Goal:
Input: row_sum_check(data)
Output: Either True
or False
3-2
Write a function and named it column_sum_check
, it shoud check whether all sums of the columns are equivalent or not using for loops (1 points).
Goal:
Input: column_sum_check(data)
Output: Either True
or False
3-3
Write a function and named it diagonal_sum_check
, it shoud check whether all sums of the diagonals are equivalent or not using for loops (1 points).
Goal:
Input: diagonal_sum_check(data)
Output: Either True
or False
3-4
Complete the function MagicSquare
where the function returns either True or False using the functions we wrote above (3 points).
Goal:
Input: MagicSquare(data)
Output: Either True
or False