Sunday, November 27, 2011

Re: (Attock VU Group) mera aj ka paper rah gaya hai kia karo plz advise me plzzzzzzzzzz

Example: Let us go through an example. We want to find the optimal multiplication order for
A1
(5×4) · A2
(4×6) · A3
(6×2) · A4
(2×7) · A5
(7×3)
We will compute the entries of the m matrix starting with the base condition. We first fill that main
diagonal:
0
0
0
0
0
Next, we compute the entries in the first super diagonal, i.e., the diagonal above the main diagonal:
m[1, 2] = m[1, 1] +m[2, 2] + p0 · p1 · p2 = 0 + 0 + 5 · 4 · 6 = 120
m[2, 3] = m[2, 2] +m[3, 3] + p1 · p2 · p3 = 0 + 0 + 4 · 6 · 2 = 48
m[3, 4] = m[3, 3] +m[4, 4] + p2 · p3 · p4 = 0 + 0 + 6 · 2 · 7 = 84
m[4, 5] = m[4, 4] +m[5, 5] + p3 · p4 · p5 = 0 + 0 + 2 · 7 · 3 = 42
The matrix m now looks as follows:
0 120
0 48
0 84
0 42
0
We now proceed to the second super diagonal. This time, however, we will need to try two possible
values for k. For example, there are two possible splits for computing m[1, 3]; we will choose the split
that yields the minimum:
m[1, 3] = m[1, 1] +m[2, 3] + p0 · p1 · p3 == 0 + 48 + 5 · 4 · 2 = 88
m[1, 3] = m[1, 2] +m[3, 3] + p0 · p2 · p3 = 120 + 0 + 5 · 6 · 2 = 180
the minimum m[1, 3] = 88 occurs with k = 1
88 CHAPTER 6. DYNAMIC PROGRAMMING
Similarly, for m[2, 4] and m[3, 5]:
m[2, 4] = m[2, 2] +m[3, 4] + p1 · p2 · p4 = 0 + 84 + 4 · 6 · 7 = 252
m[2, 4] = m[2, 3] +m[4, 4] + p1 · p3 · p4 = 48 + 0 + 4 · 2 · 7 = 104
minimum m[2, 4] = 104 at k = 3
m[3, 5] = m[3, 3] +m[4, 5] + p2 · p3 · p5 = 0 + 42 + 6 · 2 · 3 = 78
m[3, 5] = m[3, 4] +m[5, 5] + p2 · p4 · p5 = 84 + 0 + 6 · 7 · 3 = 210
minimum m[3, 5] = 78 at k = 3
With the second super diagonal computed, the m matrix looks as follow:
0 120 88
0 48 104
0 84 78
0 42
0
We repeat the process for the remaining diagonals. However, the number of possible splits (values of k)
increases:
m[1, 4] = m[1, 1] +m[2, 4] + p0 · p1 · p4 = 0 + 104 + 5 · 4 · 7 = 244
m[1, 4] = m[1, 2] +m[3, 4] + p0 · p2 · p4 = 120 + 84 + 5 · 6 · 7 = 414
m[1, 4] = m[1, 3] +m[4, 4] + p0 · p3 · p4 = 88 + 0 + 5 · 2 · 7 = 158
minimum m[1, 4] = 158 at k = 3
m[2, 5] = m[2, 2] +m[3, 5] + p1 · p2 · p5 = 0 + 78 + 4 · 6 · 3 = 150
m[2, 5] = m[2, 3] +m[4, 5] + p1 · p3 · p5 = 48 + 42 + 4 · 2 · 3 = 114
m[2, 5] = m[2, 4] +m[5, 5] + p1 · p4 · p5 = 104 + 0 + 4 · 7 · 3 = 188
minimum m[2, 5] = 114 at k = 3
The matrix m at this stage is:
6.4. CHAIN MATRIX MULTIPLY 89
0 120 88 158
0 48 104 114
0 84 78
0 42
0
That leaves the m[1, 5] which can now be computed:
m[1, 5] = m[1, 1] +m[2, 5] + p0 · p1 · p5 = 0 + 114 + 5 · 4 · 3 = 174
m[1, 5] = m[1, 2] +m[3, 5] + p0 · p2 · p5 = 120 + 78 + 5 · 6 · 3 = 288
m[1, 5] = m[1, 3] +m[4, 5] + p0 · p3 · p5 = 88 + 42 + 5 · 2 · 3 = 160
m[1, 5] = m[1, 4] +m[5, 5] + p0 · p4 · p5 = 158 + 0 + 5 · 7 · 3 = 263
minimum m[1, 5] = 160 at k = 3
We thus have the final cost matrix.
0 120 88 158 160
0 0 48 104 114
0 0 0 84 78
0 0 0 0 42
0 0 0 0 0
Here is the order in which m entries are calculated
0 1 5 8 10
0 0 2 6 9
0 0 0 3 7
0 0 0 0 4
0 0 0 0 0
and the split k values that led to a minimum m[i, j] value
0 1 1 3 3
0 2 3 3
0 3 3
0 4
0
90 CHAPTER 6. DYNAMIC PROGRAMMING
Based on the computation, the minimum cost for multiplying the five matrices is 160 and the optimal
order for multiplication is
((A1(A2A3))(A4A5))
This can be represented as a binary tree
A1
A2 A3
2
1
A4 A5
4
3
ap mujhy ye example samjha sakti hain kia


mujhy is main  ye values kaisy maloom hoti hain in ki samjh nahi aarahi hy

 m[1,2]=m[1,1]+m[2,2]+po.p1.p2=0+0+5.4.6=120

is terha ki example ko samjha dain


On Sun, Nov 27, 2011 at 11:13 AM, Shazia <shazia277@gmail.com> wrote:
sure sis........see attachment.......





On Sun, Nov 27, 2011 at 10:00 PM, sara raza <sararazameer@gmail.com> wrote:
sis shazi ap mujhy cs502 ki handout mail ker sakti hoo 

mujhy chey thii


thanks



On Sun, Nov 27, 2011 at 10:57 AM, Shazia <shazia277@gmail.com> wrote:
wasalam.......
sis send mail regarding it to exams department n also to date sheet id........


DateSheet@vu.edu.pk
Conduct@vu.edu.pk



On Sun, Nov 27, 2011 at 9:53 PM, mc110200312 Nabila Hassnain <mc110200312@vu.edu.pk> wrote:
AoA
 
dear fellows mera aj ka paper rah gaya hai plz mujy batien mai kai karu kai koi chance hai k mai dobara paper day saku?
plzzzzzzzzzzzz reply
mai buht pershan ho

--
██████████████████ Basic Group Rules ███████████████████
Immoral & Rudish talk, Earning program links, Cell number for friendship purpose, Websites/Groups Links, Adult contents, Criticize-able Islamic stuff, Spreading disruption, Spamming are strictly prohibited and banned in group.
█████████████████████████████████████████████████
 
Follow these detailed Group Rules, otherwise you will be banned at any time.
https://docs.google.com/document/d/1YJxA8x3_U7C1lRc0EXfLrJpco4A1XkB1vDxOTqOd3Jg/edit?hl=en&authkey=CNDy9tkJ
 
Group Email Address:
Attock-VU-Group@Googlegroups.Com
 
Join group by sending a blank email from University ID at:
Attock-VU-Group+Subscribe@Googlegroups.Com
 
Join us at http://www.Vusr.net for Papers,Assignments,GDBs, Quizes.
 
████████████ Click here to Join this group at Facebook:████████████
♥ ♥ ♥ https://www.facebook.com/home.php?sk=group_111877855568034 ♥ ♥ ♥
█████████████████████████████████████████████████



--






***Ya Allah! grant us good in this world and good in the hereafter,
and save us from the chastisement of the fire***

--
██████████████████ Basic Group Rules ███████████████████
Immoral & Rudish talk, Earning program links, Cell number for friendship purpose, Websites/Groups Links, Adult contents, Criticize-able Islamic stuff, Spreading disruption, Spamming are strictly prohibited and banned in group.
█████████████████████████████████████████████████
 
Follow these detailed Group Rules, otherwise you will be banned at any time.
https://docs.google.com/document/d/1YJxA8x3_U7C1lRc0EXfLrJpco4A1XkB1vDxOTqOd3Jg/edit?hl=en&authkey=CNDy9tkJ
 
Group Email Address:
Attock-VU-Group@Googlegroups.Com
 
Join group by sending a blank email from University ID at:
Attock-VU-Group+Subscribe@Googlegroups.Com
 
Join us at http://www.Vusr.net for Papers,Assignments,GDBs, Quizes.
 
████████████ Click here to Join this group at Facebook:████████████
♥ ♥ ♥ https://www.facebook.com/home.php?sk=group_111877855568034 ♥ ♥ ♥
█████████████████████████████████████████████████



--
  1. Insan Dukh nahe detay, Insano se Wabasta Umeedein dukh deti hain
Mcs 3rd semester

--
██████████████████ Basic Group Rules ███████████████████
Immoral & Rudish talk, Earning program links, Cell number for friendship purpose, Websites/Groups Links, Adult contents, Criticize-able Islamic stuff, Spreading disruption, Spamming are strictly prohibited and banned in group.
█████████████████████████████████████████████████
 
Follow these detailed Group Rules, otherwise you will be banned at any time.
https://docs.google.com/document/d/1YJxA8x3_U7C1lRc0EXfLrJpco4A1XkB1vDxOTqOd3Jg/edit?hl=en&authkey=CNDy9tkJ
 
Group Email Address:
Attock-VU-Group@Googlegroups.Com
 
Join group by sending a blank email from University ID at:
Attock-VU-Group+Subscribe@Googlegroups.Com
 
Join us at http://www.Vusr.net for Papers,Assignments,GDBs, Quizes.
 
████████████ Click here to Join this group at Facebook:████████████
♥ ♥ ♥ https://www.facebook.com/home.php?sk=group_111877855568034 ♥ ♥ ♥
█████████████████████████████████████████████████



--






***Ya Allah! grant us good in this world and good in the hereafter,
and save us from the chastisement of the fire***

--
██████████████████ Basic Group Rules ███████████████████
Immoral & Rudish talk, Earning program links, Cell number for friendship purpose, Websites/Groups Links, Adult contents, Criticize-able Islamic stuff, Spreading disruption, Spamming are strictly prohibited and banned in group.
█████████████████████████████████████████████████
 
Follow these detailed Group Rules, otherwise you will be banned at any time.
https://docs.google.com/document/d/1YJxA8x3_U7C1lRc0EXfLrJpco4A1XkB1vDxOTqOd3Jg/edit?hl=en&authkey=CNDy9tkJ
 
Group Email Address:
Attock-VU-Group@Googlegroups.Com
 
Join group by sending a blank email from University ID at:
Attock-VU-Group+Subscribe@Googlegroups.Com
 
Join us at http://www.Vusr.net for Papers,Assignments,GDBs, Quizes.
 
████████████ Click here to Join this group at Facebook:████████████
♥ ♥ ♥ https://www.facebook.com/home.php?sk=group_111877855568034 ♥ ♥ ♥
█████████████████████████████████████████████████



--
  1. Insan Dukh nahe detay, Insano se Wabasta Umeedein dukh deti hain
Mcs 3rd semester

--
██████████████████ Basic Group Rules ███████████████████
Immoral & Rudish talk, Earning program links, Cell number for friendship purpose, Websites/Groups Links, Adult contents, Criticize-able Islamic stuff, Spreading disruption, Spamming are strictly prohibited and banned in group.
█████████████████████████████████████████████████
 
Follow these detailed Group Rules, otherwise you will be banned at any time.
https://docs.google.com/document/d/1YJxA8x3_U7C1lRc0EXfLrJpco4A1XkB1vDxOTqOd3Jg/edit?hl=en&authkey=CNDy9tkJ
 
Group Email Address:
Attock-VU-Group@Googlegroups.Com
 
Join group by sending a blank email from University ID at:
Attock-VU-Group+Subscribe@Googlegroups.Com
 
Join us at http://www.Vusr.net for Papers,Assignments,GDBs, Quizes.
 
████████████ Click here to Join this group at Facebook:████████████
♥ ♥ ♥ https://www.facebook.com/home.php?sk=group_111877855568034 ♥ ♥ ♥
█████████████████████████████████████████████████

No comments:

Post a Comment