The document discusses dynamic programming and covers the longest increasing subsequence problem. It begins by defining dynamic programming as breaking down a problem into smaller subproblems and using previously solved subproblems to solve larger ones. It then covers the longest increasing subsequence problem in detail, showing how to define a table, find the recurrence relation, and calculate the solution. The example problem is finding the longest increasing subsequence of the numbers 5, 2, 8, 6, 3, 6, 9, 7. The solution is shown to be the sequence 2, 3, 6, 9, which has a length of 4.
Analytical Solution Of Schrödinger Equation With Mie–Type Potential Using Fac...ijrap
we have obtained the analytical solution of Schrödinger wave equation with Mie – type potential
using factorization method. We have also obtained energy eigenvalues of our potential and the
corresponding wave function using an ansatz and then compare the result to standard Laguerre’s
differential equation. Under special cases our potential model reduces two well known potentials such as
Coulomb and the Kratzer Feus potentials.
Convex Hull - Chan's Algorithm O(n log h) - Presentation by Yitian Huang and ...Amrinder Arora
Chan's Algorithm for Convex Hull Problem. Output Sensitive Algorithm. Takes O(n log h) time. Presentation for the final project in CS 6212/Spring/Arora.
Divide and Conquer Algorithms - D&C forms a distinct algorithm design technique in computer science, wherein a problem is solved by repeatedly invoking the algorithm on smaller occurrences of the same problem. Binary search, merge sort, Euclid's algorithm can all be formulated as examples of divide and conquer algorithms. Strassen's algorithm and Nearest Neighbor algorithm are two other examples.
An alternative learning experience in transition level mathematicsDann Mallet
QUT Mathematical Sciences Seminar series, November 1 2013
Traditionally at QUT, mathematics and statistics are taught using a face-to-face lecture/tutorial model involving large lecture classes for around 1/2 to 3/4 of the time and smaller group tutorials for the remainder of the time. This is also one of the main models for teaching at other campus-based institutions. Recently, in response to (learning) technology advances and changes in the ways learners seek education, QUT has made a significant commitment to a “Digital Transformation” project across the university. In this seminar I will present a technical overview, with some demonstrations, of a pilot project that seeks to investigate how digital transformation might work in a QUT mathematics or statistics subject. In particular, I will discuss the use of tablet PC technology and specialist software to produce video learning packages. This approach has been trialled in a transition level mathematics unit this semester. I will also cover integration of these learning packages with QUTs Learning Management System “Blackboard”. This seminar is a technical preview to another talk I will give early in the new year that will look at the impact of the altered learning experience on student outcomes, feedback and the unit itself.
Analytical Solution Of Schrödinger Equation With Mie–Type Potential Using Fac...ijrap
we have obtained the analytical solution of Schrödinger wave equation with Mie – type potential
using factorization method. We have also obtained energy eigenvalues of our potential and the
corresponding wave function using an ansatz and then compare the result to standard Laguerre’s
differential equation. Under special cases our potential model reduces two well known potentials such as
Coulomb and the Kratzer Feus potentials.
Convex Hull - Chan's Algorithm O(n log h) - Presentation by Yitian Huang and ...Amrinder Arora
Chan's Algorithm for Convex Hull Problem. Output Sensitive Algorithm. Takes O(n log h) time. Presentation for the final project in CS 6212/Spring/Arora.
Divide and Conquer Algorithms - D&C forms a distinct algorithm design technique in computer science, wherein a problem is solved by repeatedly invoking the algorithm on smaller occurrences of the same problem. Binary search, merge sort, Euclid's algorithm can all be formulated as examples of divide and conquer algorithms. Strassen's algorithm and Nearest Neighbor algorithm are two other examples.
An alternative learning experience in transition level mathematicsDann Mallet
QUT Mathematical Sciences Seminar series, November 1 2013
Traditionally at QUT, mathematics and statistics are taught using a face-to-face lecture/tutorial model involving large lecture classes for around 1/2 to 3/4 of the time and smaller group tutorials for the remainder of the time. This is also one of the main models for teaching at other campus-based institutions. Recently, in response to (learning) technology advances and changes in the ways learners seek education, QUT has made a significant commitment to a “Digital Transformation” project across the university. In this seminar I will present a technical overview, with some demonstrations, of a pilot project that seeks to investigate how digital transformation might work in a QUT mathematics or statistics subject. In particular, I will discuss the use of tablet PC technology and specialist software to produce video learning packages. This approach has been trialled in a transition level mathematics unit this semester. I will also cover integration of these learning packages with QUTs Learning Management System “Blackboard”. This seminar is a technical preview to another talk I will give early in the new year that will look at the impact of the altered learning experience on student outcomes, feedback and the unit itself.
#ITsubbotnik Spring 2017: Mikhail Khludnev "Search like %SQL%"epamspb
Поисковые сервера и библиотеки как Solr/Lucene/Elastic выполняют поиск по ключевым словам. Иногда появляется "странное" требование поиска по подстрокам, также известное в SQL как WHERE field LIKE %infix%. В докладе речь пойдёт про структуры данных индекса Lucene; о том почему этот поиск алгоритмически сложный; и как выполнить его с помощью имеющихся структур данных с минимальной кастомизацией Solr. Доклад не рассматривает SQL, Solr SQL, и суффиксные массивы; не требует от слушателей специфических знаний про поисковые машины, так как посвящён структурам данных обратного индекса и конечным трансляторам (FST).
Predict saturated thickness using tensor board visualizationVinh Nguyen
Water plays a critical role in our living and manufacturing activities. The continuously growing exploitation of water over the aquifer poses a risk for over-extraction and pollution, leading to many negative effects on land irrigation. Therefore, predicting aquifer water level accurately is urgently important, which can help us prepare water demands ahead of time. In this study, we employ the Long-Short Term Memory (LSTM) model to predict the saturated thickness of an aquifer in the Southern High Plains Aquifer System in Texas, and exploit TensorBoard as a guide for model configurations. The Root Mean Squared Error of this study shows that the LSTM model can provide a good prediction capability using multiple data sources, and provides a good visualization tool to help us understand and evaluate the model configuration.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
3. Dynamic Programming
Problem Solving Paradigm
− Identifying a collection of subproblems
− Tackling them one by one
• smallest first
• using the answer already calculated to help figure out the
larger ones
• until the whole problem is solved
One of the most prominent issue
− You can be familiar with PS with Dynamic Programming
− There are so many issues to cover
POSCAT Seminar 1-3
9 July 2014
yougatup
5. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
POSCAT Seminar 1-5
9 July 2014
yougatup
6. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
POSCAT Seminar 1-6
9 July 2014
yougatup
7. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
1. Define the Table
POSCAT Seminar 1-7
9 July 2014
yougatup
8. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
1. Define the Table
Let 𝑇(𝑖) = The length of LIS when 𝑎𝑖 is the last element
∴ 𝑎𝑖 have to be last element of subsequence
POSCAT Seminar 1-8
9 July 2014
yougatup
9. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
1. Define the Table
You can fill the table manually. What is the answer ?
POSCAT Seminar 1-9
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
10. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
1. Define the Table
Can you see the recurrence relation on 𝑇 ?
POSCAT Seminar 1-10
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
11. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
1. Define the Table
Suppose that 𝑗 < 𝑖 and 𝐷𝑎𝑡𝑎 𝑗 < 𝐷𝑎𝑡𝑎(𝑖).
Then we can add one more element to Increasing Subsequence
whose last element is 𝐷𝑎𝑡𝑎(𝑗)
POSCAT Seminar 1-11
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
12. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
1. Define the Table
Consider element 6 in the example.
POSCAT Seminar 1-12
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
13. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
1. Define the Table
We can make a Increasing Subsequence by adding 6 whose last
element is 5. ∴ we can make “5 6”
POSCAT Seminar 1-13
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
14. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
1. Define the Table
However, we can make another Increasing Subsequence by
considering 2 ! Still the length is 2
POSCAT Seminar 1-14
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
15. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
1. Define the Table
We can’t make IS with 8 because 8 > 6
POSCAT Seminar 1-15
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
16. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
1. Define the Table
We can’t
POSCAT Seminar 1-16
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
17. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
1. Define the Table
We can make ! Therefore, our length is 3.
Note that we considered all the case.
POSCAT Seminar 1-17
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
18. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
2. Find a recurrence relation
𝑇 𝑖 = max 𝑇 𝑗 + 1 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑗 < 𝑖 & 𝐷𝑎𝑡𝑎 𝑗 < 𝐷𝑎𝑡𝑎(𝑖)
POSCAT Seminar 1-18
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
19. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
3. Calculate !
You have to think about where the answer is
POSCAT Seminar 1-19
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
20. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
3. Calculate !
You have to think about where the answer is
It must be the maximum value of whole Table
POSCAT Seminar 1-20
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
21. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
Well, we can calculate the length of LIS.
Can we find subsequence itself? i.e. “2 3 6 9” in the example.
POSCAT Seminar 1-21
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
22. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
Well, we can calculate the length of LIS.
Can we find subsequence itself? i.e. “2 3 6 9” in the example.
That’s possible by writing history !
POSCAT Seminar 1-22
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
23. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
What is the answer on this example ?
POSCAT Seminar 1-23
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
24. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
What is the answer on this example ?
POSCAT Seminar 1-24
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
25. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
What is the answer on this example ?
Then the last element of LIS must be 9 because the definition of 𝑇(𝑖)
said that 𝑎𝑖 should be the last element !
POSCAT Seminar 1-25
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
26. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
Well, 9 is definitely last element of LIS.
How about other elements on LIS ?
POSCAT Seminar 1-26
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
27. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
Well, 9 is definitely last element of LIS.
How about other elements on LIS ?
𝑇(6) is 4 because we add 9 to the end of IS whose last element is 6
POSCAT Seminar 1-27
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
28. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
Therefore, 6 have to be located on the left of 9
POSCAT Seminar 1-28
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
29. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
Therefore, 6 have to be located on the left of 9
Repeat this procedure until we have no former element
POSCAT Seminar 1-29
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
30. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
Therefore, 6 have to be located on the left of 9
Repeat this procedure until we have no former element
POSCAT Seminar 1-30
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
It has no former element !
31. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
We call this procedure as “Backtrace”
To implement Backtrace, we have to write down the history.
POSCAT Seminar 1-31
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
Hist. None None 1 1 1 4 5 5
It means that former element of 𝑎5 is 𝑎4 !
32. Longest Increasing Subsequence
Problem
Find an increasing subsequence of greatest length
5 2 8 6 3 6 9 7
Implement it . It is very easy to make a stress of yours
POSCAT Seminar 1-32
9 July 2014
yougatup
index 0 1 2 3 4 5 6 7
Data 5 2 8 6 3 6 9 7
Table 1 1 2 2 2 3 4 4
Hist. None None 1 1 1 4 5 5
33. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
POSCAT Seminar 1-33
9 July 2014
yougatup
34. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
POSCAT Seminar 1-34
9 July 2014
yougatup
35. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
1. Define the Table
Give me !
POSCAT Seminar 1-35
9 July 2014
yougatup
36. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
1. Define the Table
Let 𝑇(𝑖, 𝑗) = The length of LCS between (𝑎1~ 𝑎𝑖) and (𝑏1~ 𝑏𝑗)
POSCAT Seminar 1-36
9 July 2014
yougatup
37. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
1. Define the Table Fill it manually !
POSCAT Seminar 1-37
9 July 2014
yougatup
S N O W Y
S
U
N
N
Y
38. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
1. Define the Table How can we feel it ?
POSCAT Seminar 1-38
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1
N
N
Y
39. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
Consider this situation.
POSCAT Seminar 1-39
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1
N
N
Y
40. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
First of all, we can’t “match” O and U because they are different
POSCAT Seminar 1-40
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1
N
N
Y
41. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
Therefore, we can remove one or both element
POSCAT Seminar 1-41
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1
N
N
Y
42. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
What is the length of LCS when we remove O ?
POSCAT Seminar 1-42
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1
N
N
Y
43. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
What is the length of LCS when we remove O ?
POSCAT Seminar 1-43
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1
N
N
Y
It knows !
44. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
What is the length of LCS when we remove U ?
POSCAT Seminar 1-44
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1
N
N
Y
45. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
What is the length of LCS when we remove U ?
POSCAT Seminar 1-45
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1
N
N
Y
It has !
46. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
Therefore, the value of this entry is 1
POSCAT Seminar 1-46
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1 1
N
N
Y
47. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
How about this situation ?
POSCAT Seminar 1-47
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1 1 1 1
N 1
N
Y
48. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
We can match N! because they are the same
POSCAT Seminar 1-48
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1 1 1 1
N 1
N
Y
49. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
Then, the LCS must be (LCS between “S” and “SU”) + N
POSCAT Seminar 1-49
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1 1 1 1
N 1
N
Y
50. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
Therefore, we get SN. In addition, the value of this entry is 2
POSCAT Seminar 1-50
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1 1 1 1
N 1 2
N
Y
51. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
Can you see the recurrence relation ?
POSCAT Seminar 1-51
9 July 2014
yougatup
S N O W Y
S 1 1 1 1 1
U 1 1 1 1 1
N 1 2 2 2 2
N 1 2 2 2 2
Y 1 2 2 2 3
52. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
2. Find a recurrence relation
POSCAT Seminar 1-52
9 July 2014
yougatup
53. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
2. Find a recurrence relation
𝑇 𝑖, 𝑗 = 𝑇 𝑖 − 1, 𝑗 − 1 + 1 𝑖𝑓 𝑎𝑖 = 𝑏𝑗
max 𝑇 𝑖 − 1, 𝑗 , 𝑇 𝑖, 𝑗 − 1 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
POSCAT Seminar 1-53
9 July 2014
yougatup
54. Longest Common Subsequence
Problem
Find an Longest Common Subsequence
S N O W Y
S U N N Y
3. Calculate !
Think about backtrace. It will be easy if you understand DP well.
POSCAT Seminar 1-54
9 July 2014
yougatup
55. Dynamic Programming
Remember. 3 step is enough.
− The first step is the most important thing. Finding the
recurrence relation is not that hard commonly.
− I showed somewhat detail explanation of solving procedure
because it is first time to you
− From the next time, I will just let you know what the definition
of Table and the recurrent relation is
Please solve all the problem
POSCAT Seminar 1-55
9 July 2014
yougatup