113 年 國立嘉義大學資訊工程學系碩士班《離散數學》
第 1 題20 分
Suppose is some binary predicate defined on a very small domain of discourse: just the integers 1, 2, 3, and 4. For each of the 16 pairs of these numbers, is either true (T) or false (F), according to the following table (x values are rows, y values are columns).
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 1 | T | F | F | F |
| 2 | F | T | T | F |
| 3 | T | T | T | T |
| 4 | F | F | F | F |
For example, is false, as indicated by the F in the first row, third column. Use the table to decide whether the following statements are true, false or not enough information. Please give the related description about the reasons of your answers.
(a)
(b)
(c)
(d)
登入後即可作答並保存紀錄。
核心觀念
全稱量詞 表示「每一個」都符合;存在量詞 表示「至少有一個」符合。判斷時,依量詞順序檢查真值表即可:
- :每一列都至少有一個 。
- :每一欄都至少有一個 。
- :至少有一列全部是 。
- :至少有一欄全部是 。
解題方法
依原圖中的式子判斷。表格各列為:
- :
- :
- :
- :
逐列檢查「每列是否有 」,逐欄檢查「每欄是否有 」;若要判斷是否存在全為 的列或欄,就檢查是否有一整列或一整欄皆為 。
選項分析
(a) :錯誤。此式要求每一列都至少有一個 ,但 這一列全是 ,不符合條件。
第 2 題20 分
Given , , and for ;
Solve the equation.
登入後即可作答並保存紀錄。
核心觀念
本題考查二階非齊次常係數線性遞迴關係(Second-Order Non-Homogeneous Linear Recurrence Relation with Constant Coefficients)的求解。
求解此類遞迴關係式包含以下核心步驟:
-
齊次通解(Homogeneous Solution, ):
將等號右側非齊次項設為 ,得到齊次遞迴關係式。解其特徵方程式(Characteristic Equation)求出特徵根 。若特徵根為相異實根,則齊次通解為:
-
特設解(Particular Solution, ):
根據非齊次項 的形式,利用**未定係數法(Method of Undetermined Coefficients)**假設特設解。由於非齊次項中的底數 恰好為特徵方程式的單重根(重數 ),依據修正法則,特設解形式須乘上 ,即設為:
將其代回原遞迴關係式求出未知係數 。 -
完全解(General Solution, )與初始條件:
完全解為齊次通解與特設解之和()。最後代入初始條件 與 ,解出常數 與 。
解題方法
步驟一:求解齊次解
考慮對應的齊次遞迴關係式:
寫出特徵方程式:
因式分解:
解得特徵根:
因此,齊次解的形式為:
步驟二:求解特設解
原式的非齊次項為 。
因為 已是齊次特徵方程式的單重根,故特設解應設為:
將 代回原遞迴關係式 :
兩邊同除以 :
第 3 題5 分
According to the values of a and b given in the following, find by the division algorithm, the values of q and r such that, , where .
(a) (5%)
(b) (5%)
登入後即可作答並保存紀錄。
核心觀念
本題考查數論(Number Theory)中的核心基礎——除法定理(Division Algorithm)。
-
除法定理定義:
對任意兩整數 (被除數)與 (除數,且 ),必存在唯一的一組整數 (商數,Quotient)與 (餘數,Remainder),滿足:
-
關鍵限制條件:
餘數 的範圍必須符合 。此條件規定餘數必須為非負整數。當被除數 為負數時,商數 必須向負無窮大方向取整數(即地板函數 ),確保算出的餘數 。
解題方法
根據除法定理的公式 (限制 ),分別推導兩小題:
(a) 當 時
-
求商數 :
將 除以 並取地板函數(向下取整):
-
求餘數 :
依據 計算:
-
驗證區間條件:
檢查餘數範圍是否符合 :
完全符合除法定理規範。
(b) 當 時
-
求商數 :
將 除以 並取地板函數(向下取整):
-
求餘數 :
依據 計算:
第 4 題10 分
The pre-order traversal sequence of a binary search tree is 31, 21, 11, 16, 26, 24, 40, 36, 43.
(a) What is the in-order traversal?(10%)
(b) What is the post-order traversal?(10%)
登入後即可作答並保存紀錄。
二元搜尋樹(BST)滿足「左子樹鍵值 根節點 右子樹鍵值」。依前序序列重建:
31
/ \
21 40
/ \ / \
11 26 36 43
\ /
16 24
第 5 題10 分
About the probability
(a) What is the probability that a positive integer selected at random from the set of positive integers not exceeding 100 is divisible by either 3 or 5? (10%)
(b) What is the probability that a positive integer selected at random from the set of positive integers not exceeding 1000 is NOT divisible by either 7 or 9? (10%)
登入後即可作答並保存紀錄。
核心觀念
本題為離散數學中「組合計數(Combinatorics)」與「離散機率(Discrete Probability)」的典型綜合題,核心觀念包含:
- 古典機率(Classical Probability):在有限且等可能的樣本空間 中,任意事件 發生的機率定義為:
- 取捨原理(Inclusion-Exclusion Principle,又稱排容原理):對於任意兩個有限集合 與 ,其聯集的元素個數為:
- 整數倍數計數與地板函數(Floor Function):在不大於正整數 的正整數集合中,能被正整數 整除的數字個數為 。若要同時被 與 整除,則該數字必須被其最小公倍數 整除。
- 餘事件定理(Complementary Event Theorem):事件 不發生的機率等於 1 減去事件 發生的機率:
解題方法
- (a) 小題切入點:求不大於 100 且能被 3 或 5 整除的整數個數。直接定義事件 (被 3 整除)與事件 (被 5 整除),利用取捨原理計算聯集個數 ,再除以總數 即可。
- (b) 小題切入點:求不大於 1000 且「不能」被 7 或 9 整除的整數個數。由於正面討論「兩者皆不能整除」比較複雜,採用「餘事件法」:先求能被 7 或 9 整除的事件個數 ,再以總個數 1000 扣除該值得到餘事件個數,最後計算出機率。
子題詳細推導與分析
(a) 不大於 100 且能被 3 或 5 整除的機率
-
定義樣本空間與事件:
- 樣本空間 ,總個數 。
- 設集合 為 中能被 3 整除的整數集合。
- 設集合 為 中能被 5 整除的整數集合。
-
計算各集合之元素個數:
- 能被 3 整除的個數:
- 能被 5 整除的個數:
- 同時能被 3 與 5 整除(即能被 整除)的個數:
- 能被 3 整除的個數:
第 6 題10 分
A cookie shop has 7 different kinds of cookies. How many different ways can 10 cookies be chosen? Assume that only the type of cookie, and not the individual cookies or the order in which they are chosen, matters. (10%)
登入後即可作答並保存紀錄。
設第 種餅乾選取 個,則