• 沒有找到結果。

Divide and Conquer II

N/A
N/A
Protected

Academic year: 2022

Share "Divide and Conquer II"

Copied!
41
0
0

加載中.... (立即查看全文)

全文

(1)

Michael Tsai 2011/09/23

(2)

矩陣相乘

(3)

矩陣相乘 – 基本法

n個 n個

Running time = ?

(4)

矩陣相乘 – D&C嘗試一

Recursive case:

(5)

矩陣相乘 – D&C嘗試一

Base case:

(6)

矩陣相乘 – D&C嘗試一

(7)

Base case

Recursive case

Combine

(8)

矩陣相乘 – Strassen’s method

德國數學家 Volker Strassen 攝於2009年

(9)

矩陣相乘 – Strassen’s method

(10)

矩陣相乘 – Strassen’s method

Not at all obvious

(11)

矩陣相乘 – Strassen’s method

Not at all obvious

(12)

矩陣相乘 – Strassen’s method

(13)

接下來…

問題: 我們要怎麼解遞迴式?

取代法

遞迴樹法

大師定理法

http://www.origin-zero.com/senzi/JOKE1.jpg

(14)

取代法

猜答案的形式 用數學歸納法證明此

形式成立 得到遞迴式的解 成功

失敗

(15)

取代法-例子

(16)

取代法-例子

(17)

取代法-例子

(18)

取代法-例子

(19)

取代法-怎麼猜?

靠經驗.

跟沒講一樣.

一些小方法:

1. 根據以前看過類似的遞迴式來猜測

2. 使用等一下要介紹的遞迴樹

3. 證明比較鬆的upper bound或lower bound來慢慢 接近tight bound

老工匠

(20)

取代法-小技巧1

(21)

取代法-小技巧1

(22)

取代法–小技巧2

暫時不管flooring

(23)

遞迴樹法

畫出遞迴樹

用數學歸納法證明此 解成立

用比較不嚴謹的方法 加總得到解

(24)

………

(25)

(26)

遞迴樹法–例子1

(27)

遞迴樹法–例子2

(28)

遞迴樹法–例子2

(29)

(30)

大師定理

Which one is polynomially larger/smaller?

The same order

(31)

(32)

大師定理-例子2

(33)

大師定理-更多例子

上台解題時間…

(34)

取數問題

(35)

取數問題

(36)

取數問題

n個數

小於等於a的

某數a (pivot)

大於a的

(37)

取數問題

(38)

取數問題

差不多的中位數:

1. 把n個數分成很多大小為5個的sub list (大約共 有n/5個sub list

2. 這些sub list中各自找中位數

3. 找出n/5個中位數中的中位數

此為差不多的中位數

(39)

取數問題

中位數的中位數

(40)

取數問題

(41)

作業一上線

5 problem sets, 100 points

1 programming assignment, 4 writing assignments

Judge girl system accounts are sent last night

Please give it a try

Due 2 weeks from next Tuesday (Oct. 11)

參考文獻

相關文件

– Determine whether it is possible to design a distributed exact MST algorithm with better work complexity than GHS and obt ain a lower bound on work

Lower bound on the cost of any algorithm in the GST model is generalized from the interleave lower bound of BST 3 to search trees on

• Progress of using circuit complexity to prove exponential lower bounds for NP-complete problems has been slow.. – As of January 2006, the best lower bound is 5n

The performance guarantees of real-time garbage collectors and the free-page replenishment mechanism are based on a constant α, i.e., a lower-bound on the number of free pages that

Other vegetable materials plaits and similar products, whether or not assembled into strips; products of other vegetable materials, bound together in parallel strands or woven,

For periodic sequence (with period n) that has exactly one of each 1 ∼ n in any group, we can find the least upper bound of the number of converged-routes... Elementary number

If the subset has constant extrinsic curvature and is a smooth manifold (possibly with boundary), then it has an explicit intrinsic lower curvature bound which is sharp in

The function f (m, n) is introduced as the minimum number of lolis required in a loli field problem. We also obtained a detailed specific result of some numbers and the upper bound of