DP

So, if you see the words “how many” or “minimum” or “maximum” or “shortest” or “longest” in a problem statement, chances are good that you’re looking at a DP problem!

pages.cs.wisc.edu/~calvin/cs110/RECURSION.html
http://www.doc.ic.ac.uk/~wjk/c++Intro/CourseStructure.html#S8

math tricks

1 from the equation of x^3-1=0 we find 1,Ω AND Ω^2
in other words we say we find Ω and Ω^2 from x^2+x+1=0

proof:

x^3-1=0
(x-1)(x^2+x+1)=0
so x=1 and solving x^2+x+1=0 we find Ω and Ω^2

2 from the equation of x^2 – X -1 =0 WE FIND PHI Φ(golden ratio) and (Golden Ratio Conjugate)(silver ratio)(1-sqrt(5)/2

summary

(x^2+x+1)=0 Ω AND Ω^2
x^2 – X -1=0 phi OR (golden ratio) OR Φ
and (Golden Ratio Conjugate)(silver ratio)
(1-sqrt(5)/2

FEW RELATION

Phi = 1/phi

= phi-1

= 2/(1+sqrt(5))

= (sqrt(5)-1)/2

= 0.6180339887…

3 ধর তোমাকে বলা হল, ১ থেকে ৩০-র মধ্যে এমন কয়টি সংখ্যা আছে, যা ৩ অথবা ৫ দিয়ে বিভাজ্য।

আমরা ৩ দিয়ে বিভাজ্য সংখ্যাগুলো বের করতে পারি এভাবেঃ N(A) = 30/3(so nice) = 10

এই সংখ্যাগুলো হলঃ 3, 6, 9, 12, 15, 18, 21, 24, 27, 30

একই ভাবে ৫ দ্বারা বিভাজ্য সংখ্যাঃ N(B) = 30/5(so nice) = 6

এই সংখ্যাগুলো হলঃ 5, 10, 15, 20, 25, 30

এখন খেয়াল কর, 15, 30 এই সংখ্যা দু’টি আমরা দুই বার হিসেব করেছি। তাহলে আমাদেরকে একবার করে এটা বাদ দিতে হবে। এরা হল ১৫-এর গুণিতক। ১৫ হল ৩ এবং ৫-এর লসাগু(LCM)। এখনঃ N(A∩B) = 30/15(so nice) = 2