1 高等演算法 Homework One 暨南大學資訊工程學系 黃光璿 2004/11/11. 2 Problem 1.

Slides:



Advertisements
Similar presentations
Routing Complexity of Faulty Networks Omer Angel Itai Benjamini Eran Ofek Udi Wieder The Weizmann Institute of Science.
Advertisements

Analysis of Algorithms
110/6/2014CSE Suprakash Datta datta[at]cse.yorku.ca CSE 3101: Introduction to the Design and Analysis of Algorithms.
Problems and Their Classes
Advanced Topics in Algorithms and Data Structures
Lower Bounds for Sorting, Searching and Selection
Connective Fault Tolerance in Multiple-Bus System Hung-Kuei Ku and John P. Hayes IEEE Transactions on parallel and distributed System, VOL. 8, NO. 6, June.
An Introduction to Channel Routing
Distributed Computing 1. Lower bound for leader election on a complete graph Shmuel Zaks ©
Analysis of Algorithms
Sorting Comparison-based algorithm review –You should know most of the algorithms –We will concentrate on their analyses –Special emphasis: Heapsort Lower.
Exact algorithms for the minimum latency problem Exact algorithms for the minimum latency problem 吳邦一 黃正男 詹富傑 樹德科大 資工系.
INF 212 ANALYSIS OF PROG. LANGS Type Systems Instructors: Crista Lopes Copyright © Instructors.
© The McGraw-Hill Companies, Inc., Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Approximation Algorithm for Multicut
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
Sorting Heapsort Quick review of basic sorting methods Lower bounds for comparison-based methods Non-comparison based sorting.
16:36MCS - WG20041 On the Maximum Cardinality Search Lower Bound for Treewidth Hans Bodlaender Utrecht University Arie Koster ZIB Berlin.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
中正大學通訊工程系 潘仁義老師 Advanced Network Technology Lab Common Programming Errors Syntax Errors (Figure 2.15) –missing semicolon at the end of the variable.
2 -1 Analysis of algorithms Best case: easiest Worst case Average case: hardest.
DAST 2005 Tirgul 11 (and more) sample questions. DAST 2005 Q.Let G = (V,E) be an undirected, connected graph with an edge weight function w : E→R. Let.
Analysis of Algorithms1 Estimate the running time Estimate the memory space required. Time and space depend on the input size.
Increasing graph connectivity from 1 to 2 Guy Kortsarz Joint work with Even and Nutov.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
A new predictive search area approach for fast block motion estimation Kuo-Liang Chung ( 鍾國亮 ) Lung-Chun Chang ( 張隆君 ) 國立台灣科技大學資訊工程系暨研究所 IEEE TRANSACTIONS.
1 Chapter 1-- Introduction Chapter 2-- Algorithms and Complexity 暨南大學資訊工程系 黃光璿 (Guan-Shieng Huang) 2005/02/21.
The Complexity of Algorithms and the Lower Bounds of Problems
 Compound Inequality › Two inequalities that are joined by the word and or the word or.
1 Multiple Sequence Alignment 暨南大學資訊工程學系 黃光璿 2004/05/31.
1.1 Chapter 1: Introduction What is the course all about? Problems, instances and algorithms Running time v.s. computational complexity General description.
NDSL, Chang Gung University, 2.1 Chapter 2 Network Models 長庚大學資訊工程學系 陳仁暉 副教授 Tel: (03) Ext: 5990
Introduction For some compiler, the intermediate code is a pseudo code of a virtual machine. Interpreter of the virtual machine is invoked to execute the.
Copyright © 2012, A Minimum Cost Resource Allocation Approach for Cloud Data Centers 指導教授:王國禎 學生:連懷恩 國立交通大學資訊工程系 行動計算與寬頻網路實驗室 1.
1 中華大學資訊工程學系 Ching-Hsien Hsu ( 許慶賢 ) Localization and Scheduling Techniques for Optimizing Communications on Heterogeneous.
Lecture 16 Maximum Matching. Incremental Method Transform from a feasible solution to another feasible solution to increase (or decrease) the value of.
Graph Theory Chapter 7 Eulerian Graphs 大葉大學 (Da-Yeh Univ.) 資訊工程系 (Dept. CSIE) 黃鈴玲 (Lingling Huang)
Higher Grade Computing Studies 4. Standard Algorithms Higher Computing Software Development S. McCrossan 1 Linear Search This algorithm allows the programmer.
Télécom 2A – Algo Complexity (1) Time Complexity and the divide and conquer strategy Or : how to measure algorithm run-time And : design efficient algorithms.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 33.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
1 離散對數密碼系統 交通大學資訊工程系 陳榮傑. 2 Outline 離散對數問題 (Discrete Logarithm Problem) 離散對數演算法 (DL Algorithms) –A trivial algorithm –Shanks’ algorithm –Pollard’s algorithm.
The Simplex Algorithm 虞台文 大同大學資工所 智慧型多媒體研究室. Content Basic Feasible Solutions The Geometry of Linear Programs Moving From Bfs to Bfs Organization of a.
Data Structures & Algorithms Graphs
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Chapter 18: Searching and Sorting Algorithms. Objectives In this chapter, you will: Learn the various search algorithms Implement sequential and binary.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
Location-Aware 吳俊興 國立高雄大學 資訊工程學系 CSF645 – Mobile Computing 行動計算
A Membrane Algorithm for the Min Storage problem Dipartimento di Informatica, Sistemistica e Comunicazione Università degli Studi di Milano – Bicocca WMC.
Chapter 6 Connectivity and Flow 大葉大學 資訊工程系 黃鈴玲
Lower bounds on data stream computations Seminar in Communication Complexity By Michael Umansky Instructor: Ronitt Rubinfeld.
Algorithmics - Lecture 41 LECTURE 4: Analysis of Algorithms Efficiency (I)
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
國立台灣大學 資訊工程學系 Chapter 7: Deadlocks. 資工系網媒所 NEWS 實驗室 Chapter Objectives To develop a description of deadlocks, which prevent sets of concurrent processes.
1 Problems of Perfect Multi- Secret Sharing Schemes Advisor: 阮夙姿教授 Presenter: 蔡惠嬋 Date: 2008/08/11 國立暨南國際大學資訊工程學系.
Chapter 7 Planar Graphs 大葉大學 資訊工程系 黃鈴玲  7.2 Planar Embeddings  7.3 Euler’s Formula and Consequences  7.4 Characterization of Planar Graphs.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
CMPT 120 Topic: Searching – Part 2 and Intro to Time Complexity (Algorithm Analysis)
The NP class. NP-completeness
New Characterizations in Turnstile Streams with Applications
Richard Anderson Lecture 26 NP-Completeness
Lecture 16 Bipartite Matching
Richard Anderson Lecture 25 NP-Completeness
Coverage Approximation Algorithms
Trevor Brown DC 2338, Office hour M3-4pm
The Complexity of Approximation
Presentation transcript:

1 高等演算法 Homework One 暨南大學資訊工程學系 黃光璿 2004/11/11

2 Problem 1

3 Problem 2 Count the number of inversions for the permutation

4 Problem 3 Explain when we can say that an algorithm for solving a problem is optimal, in the sense of theoretical analysis.  When the complexity of the algorithm matches the complexity lower bound for the problem that the algorithm intends to solve.

5 Problem 4 Show that to find the largest number in an array of n numbers requires at least n-1 comparisons.  This problem asks to show that n-1 comparisons is the lower bound for any algorithm that guarantees the maximum.  The claim is true under the condition that you want to find the maximum only by comparisons.

6 Let each number be a node in a graph. When two numbers are compared, link them by an edge. If only n-2 comparisons are being used, the graph cannot be connected. There are at least two components, and you cannot make sure which one contains the maximum.

7 However, in the next slide, I will show you an algorithm that compute the maximum without using any comparison.

8 The idea is simple. We can use arithmetic and logical operations to emulate the action of comparisons.  a > b iff a – b > 0  Extract the sign bit of a – b and call it s ( a, b ).  Then returns the maximum of a and b.

9 The computation can be even more complex. In fact, we can compute the index of the maximum without using the temporary variable.

10