This document contains solutions to 10 algorithm problems. It begins by providing efficient O(n) time algorithms to: 1) Remove digits from an integer to maximize its value. 2) Find a subsequence of integers that sums to a given value k. It then provides linear time algorithms to: 3) Find the largest square submatrix of 1s in a binary matrix. 4) Find a maximum independent set on trees. It also provides efficient algorithms to: 5) Find the maximum/minimum product substrings. 6) Find the maximum sum substring of length <=L. 7) Find a weight maximizing increasing value subsequence. Finally, it provides two algorithms to solve Problem 10154 on finding maximum weight within a strength limit.
1) The document discusses problems related to complexity classes P and NP. It shows that several problems are NP-complete, including the Hamiltonian cycle problem, subgraph isomorphism problem, 0-1 integer programming problem, and Hamiltonian path problem.
2) It provides algorithms and reductions to prove several problems are NP-complete, such as reducing Hamiltonian cycle to the subgraph isomorphism problem and reducing 3-SAT to the 0-1 integer programming problem.
3) It also discusses properties of complexity classes P and NP, such as showing P is closed under certain operations and contained within NP intersect co-NP.
The document contains solutions to several algorithm problems. For problem 1, it provides two solutions: 1) A divide-and-conquer algorithm that finds the rank of points in O(n log n) time by sorting and merging. 2) A sweep line algorithm using a binary indexed tree that also runs in O(n log n) time. For problem 2, it describes a selection algorithm solution that finds the median in O(n) time and partitions the items around the median, recursively solving in halves. For problem 3, it uses a pigeonhole principle argument to identify good chips in O(n) tests by randomly pairing chips and eliminating inconsistent results.
The document discusses algorithms for solving various optimization problems related to knapsack problems and scheduling problems. It begins by describing an efficient linear-time algorithm to find the largest subrectangle of 1s in a binary matrix using dynamic programming. It then discusses improvements to the space complexity of the 0/1 knapsack problem and algorithms for variants where items have unlimited quantities or values. Finally, it proposes algorithms for problems involving scheduling jobs on a single machine to maximize profit while meeting deadlines and partitioning a list into subsets with minimal sum difference.
The document contains the solutions to several algorithm questions. It begins by discussing a recursive Fibonacci number program, calculating that it performs Gn = Fn - 1 additions for the nth term. It then provides two more efficient algorithms using dynamic programming with an array or matrix exponentiation with O(log n) time. Subsequent questions discuss quicksort's O(log n) space complexity, deriving a closed formula for a divide-and-conquer recurrence, and proving properties about the minimum of |x-xi| and maximum product partition of a number.
The document discusses solutions to several algorithm questions.
For Q1, it summarizes that incrementing and resetting a binary counter can be done in O(n) time by keeping a pointer to the highest set bit.
For Q2, it shows that a queue can be implemented with two stacks in O(1) amortized time by pushing and popping between the stacks as needed.
For Q3, it explains that while the amortized costs of insert and extract-min for a binary heap are O(logn) and O(1) respectively, this does not imply the overall time complexity of heapsort is O(n).
For Q4, it proposes a solution
This document presents an algorithm for finding the minimum local disk cover sets for broadcasting in heterogeneous wireless ad hoc networks. It defines the problem and introduces the concept of a "skyline set" to represent the solution. It then proves several lemmas about the geometry of intersecting disks and uses mathematical induction to show that the number of arcs in any skyline set is upper bounded by 2n, where n is the number of disks. This allows the algorithm to run in O(n log n) time by using a divide-and-conquer approach to merge partial skyline sets.
This document discusses using n-grams as features for sentiment classification. It explores using high order n-grams to capture positive and negative expressions that are difficult to model with patterns. It describes combining unigrams and bigrams to improve performance over using bigrams alone. The document also discusses reducing n-gram data to reduce computational complexity and picking top features based on statistical measures. It presents experiments comparing language models, passive-aggressive, and Winnow classifiers on sentiment classification tasks.
首先,所讀這一篇的論文名稱為『Agile Development and User Experience Design Integration as an Ongoing Achievement in Practice』 所以著重點在于用戶體驗設計要怎麼融入敏捷開發的探討。
http://morris821028.github.io/2014/05/14/hw-agile-paper/
This document contains solutions to 10 algorithm problems. It begins by providing efficient O(n) time algorithms to: 1) Remove digits from an integer to maximize its value. 2) Find a subsequence of integers that sums to a given value k. It then provides linear time algorithms to: 3) Find the largest square submatrix of 1s in a binary matrix. 4) Find a maximum independent set on trees. It also provides efficient algorithms to: 5) Find the maximum/minimum product substrings. 6) Find the maximum sum substring of length <=L. 7) Find a weight maximizing increasing value subsequence. Finally, it provides two algorithms to solve Problem 10154 on finding maximum weight within a strength limit.
1) The document discusses problems related to complexity classes P and NP. It shows that several problems are NP-complete, including the Hamiltonian cycle problem, subgraph isomorphism problem, 0-1 integer programming problem, and Hamiltonian path problem.
2) It provides algorithms and reductions to prove several problems are NP-complete, such as reducing Hamiltonian cycle to the subgraph isomorphism problem and reducing 3-SAT to the 0-1 integer programming problem.
3) It also discusses properties of complexity classes P and NP, such as showing P is closed under certain operations and contained within NP intersect co-NP.
The document contains solutions to several algorithm problems. For problem 1, it provides two solutions: 1) A divide-and-conquer algorithm that finds the rank of points in O(n log n) time by sorting and merging. 2) A sweep line algorithm using a binary indexed tree that also runs in O(n log n) time. For problem 2, it describes a selection algorithm solution that finds the median in O(n) time and partitions the items around the median, recursively solving in halves. For problem 3, it uses a pigeonhole principle argument to identify good chips in O(n) tests by randomly pairing chips and eliminating inconsistent results.
The document discusses algorithms for solving various optimization problems related to knapsack problems and scheduling problems. It begins by describing an efficient linear-time algorithm to find the largest subrectangle of 1s in a binary matrix using dynamic programming. It then discusses improvements to the space complexity of the 0/1 knapsack problem and algorithms for variants where items have unlimited quantities or values. Finally, it proposes algorithms for problems involving scheduling jobs on a single machine to maximize profit while meeting deadlines and partitioning a list into subsets with minimal sum difference.
The document contains the solutions to several algorithm questions. It begins by discussing a recursive Fibonacci number program, calculating that it performs Gn = Fn - 1 additions for the nth term. It then provides two more efficient algorithms using dynamic programming with an array or matrix exponentiation with O(log n) time. Subsequent questions discuss quicksort's O(log n) space complexity, deriving a closed formula for a divide-and-conquer recurrence, and proving properties about the minimum of |x-xi| and maximum product partition of a number.
The document discusses solutions to several algorithm questions.
For Q1, it summarizes that incrementing and resetting a binary counter can be done in O(n) time by keeping a pointer to the highest set bit.
For Q2, it shows that a queue can be implemented with two stacks in O(1) amortized time by pushing and popping between the stacks as needed.
For Q3, it explains that while the amortized costs of insert and extract-min for a binary heap are O(logn) and O(1) respectively, this does not imply the overall time complexity of heapsort is O(n).
For Q4, it proposes a solution
This document presents an algorithm for finding the minimum local disk cover sets for broadcasting in heterogeneous wireless ad hoc networks. It defines the problem and introduces the concept of a "skyline set" to represent the solution. It then proves several lemmas about the geometry of intersecting disks and uses mathematical induction to show that the number of arcs in any skyline set is upper bounded by 2n, where n is the number of disks. This allows the algorithm to run in O(n log n) time by using a divide-and-conquer approach to merge partial skyline sets.
This document discusses using n-grams as features for sentiment classification. It explores using high order n-grams to capture positive and negative expressions that are difficult to model with patterns. It describes combining unigrams and bigrams to improve performance over using bigrams alone. The document also discusses reducing n-gram data to reduce computational complexity and picking top features based on statistical measures. It presents experiments comparing language models, passive-aggressive, and Winnow classifiers on sentiment classification tasks.
首先,所讀這一篇的論文名稱為『Agile Development and User Experience Design Integration as an Ongoing Achievement in Practice』 所以著重點在于用戶體驗設計要怎麼融入敏捷開發的探討。
http://morris821028.github.io/2014/05/14/hw-agile-paper/
9. ACS – GA 算法 (蟻群遺傳混合算法) – (3)
▪ 運行方式
2014/5/6Morris' blog 9
10. ACS – GA 算法 (蟻群遺傳混合算法) – (4)
▪ 換句話說,將螞蟻的能力也各自數據化
▪ 對於產生較好解的螞蟻,繁殖、交配、突變
▪ 接著談論如何運用在 CART!
2014/5/6Morris' blog 10
11. ACS – GA – CART Algorithm (1)
2014/5/6Morris' blog 11
▪ 假解亂做前,如何隨機?
▪ CART 是一棵二分樹
▪ How we do ?
A
B
D E
C
F G
12. ACS – GA – CART Algorithm (2)
2014/5/6Morris' blog 12
▪ How We Do?
▪ 基於深度優先的方式,直到某個葉節點的分類種數 < 30 或深度大於某個
值,就退回。
▪ 每一層必須決定 “依據哪個屬性分類”
Age ? Gender ? Last R ?
▪ 分類時,又要按照什麼 數值 進行分割。
< 30 ? > 30 ? = 30 ?
13. ACS – GA – CART Algorithm (3)
2014/5/6Morris' blog 13
▪ 假設 CART 有 m 個節點,n 個分類描述。
// 在此篇中,化合物有 202 種描述,即 n = 202。
▪ 為了表示螞蟻的判斷能力
▪ 到達某個節點 i 時,採用下一個分類方式 k 的費洛蒙 M[i][k]
▪ i < m, k < n
▪ 這樣可以決定分類方式。
▪ 對於某個節點 i,i 可以是目前累計完成的節點個數,或者是其他。
14. ACS – GA – CART Algorithm (4)
2014/5/6Morris' blog 14
▪ 上一篇決定了分類方式,但沒決定分割點 ( cut point )
的選擇方式。
▪ 假設用 10 種決策方式,來對應分類到節點內有的所有
項目屬性,進行統計分類。
▪ 決策方式 1:平均、眾數、權重、 ID3、C4.5 (熵理論和訊
息增益) … 等分割策略
▪ 決策方式 2 : 用 10 個常數對於屬性最大最小值
f(min, max) = x0 * min + x1 * max + x2 * min * max
▪ 決策方式 3:最大最小值之間切 10 等分。
▪ 那費洛蒙將會有 10 × n × m,即 M[10][n][m]。