Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

FUCKING DYNAMIC PROGRAMMING

Name: Anonymous 2009-12-16 12:05

How do I learn to do this shit?

I'm going to fail introduction to algorithms and be the disgrace of MIT...

Name: Anonymous 2009-12-16 12:12

PROTIP, it's the same as recursive programming but you reuse the old values.

Name: Anonymous 2009-12-16 12:13

>>2
That's recursive with memoization, faggot

Name: Anonymous 2009-12-16 12:29

Dynamic programming is the act of changing all your functions and variables in the middle of a project without telling anyone else on the project.

Name: Anonymous 2009-12-16 12:34

>>4
Not all, you'll alert them.
The best option is to swap two parameters of the same type.

Name: Anonymous 2009-12-16 12:34

Haskell. Haskell Nomads.

Name: Anonymous 2009-12-16 13:26

Hahah noobs

Name: Anonymous 2009-12-16 13:28

Haskell boobs!

Name: Anonymous 2009-12-16 13:29

(\dick -> (.)(.))

Name: Anonymous 2009-12-16 13:37

>>3
that's dynamic programming

Name: Anonymous 2009-12-16 13:54

>>10
Well, the course slides explicitly state that it's not, but I should take the arbitrary claim of an anonymous person on the internet over them I guess.

Name: clever guy 2009-12-16 14:23

>>11
Memoization isn't really dynamic programming, but it's similar in principle. Memoization saves the results of *all* function calls whereas dynamic programming saves only those that will be needed again, and generally throws out a result that is no longer needed. Compare these two versions of fibs:

MEMOIZED:

fibt = {1, 1}
for i = 3, n do
  fibt[i] = fibt[i - 1] + fibt[i - 2]
end
return fibt[n]

DYNAMICALLY PROGRAMMED:

i, j = 1, 1
for i = 3, n do
  local t = i
  i = i + j
  j = t
end
return i

(the loop can be optimized to "i = i + j; j = i - j", but dealing with t explicitly helps to explain the logic behind what is going on)

The difference between the two is that in the memoized version all previous values are stored, whereas in the dynamically programmed version only the last two values are stored, since they are the only ones that will be necessary to calculate the next value. Of course, there are problems where dynamic programming is extremely difficult or impossible to implement, since it is very hard to know which values are no longer needed.

Name: Anonymous 2009-12-16 14:52

>>9
\dick -> (.) (.) :: t -> (a1 -> b -> c) -> a1 -> (a -> b) -> a -> c

Since "dick" is unused, it's simpler just to write (.) (.) :: (a1 -> b -> c) -> a1 -> (a -> b) -> a -> c, and it's easier to comprehend if you rename the type variables.

let boobs = (.) (.) :: (b -> c -> d) -> b -> (a -> c) -> a -> d

Lets name the arguments to "boobs" f, b, g and a. It is then likely equivalent to the following definition

let boobs f b g a = f b (g a)

Name: Anonymous 2009-12-16 15:15

>>13
You're forgetting the t ->.
Make it boobs = (.) (.) . const

>>12
A Lua programmer, in my Prague??

Name: Anonymous 2009-12-16 15:37

Too complicated for my taste.

Name: Anonymous 2009-12-16 16:33

>>15
TRY MY ANUS. It's not complicated at all. Just a hole with a pipe

Name: Anonymous 2009-12-17 5:30

>>13
Always interesting to know that the boobs operator is valid Haskal.

Name: Anonymous 2009-12-17 12:13

>>12
Almost right, except that it's exactly the other way around.

Yes, yes, IHBT.

Name: Anonymous 2009-12-17 13:30

>>14
Only languages worth using, except for fibs bullshit, are C, Lua, and Scheme.

Name: Anonymous 2009-12-17 13:49

>>19
Lua
U MENA HASKAL?

Name: Anonymous 2009-12-17 14:31

>>19
I'm not sure why I don't see BBCode on that list...

Name: Anonymous 2009-12-17 17:15

>>21
BBCode doesn't support tail recursion.

Name: Anonymous 2009-12-17 17:31

I use ruby all the time . It's so hipster and cool... oh yeah and im learning japanese and my japanese teacher is so kawaii.. and i've just bought a bento box.. desu desu

Name: Anonymous 2009-12-18 2:41

>>23
Post rating: ★☆☆☆☆
Try harder next time!

Name: Anonymous 2010-12-06 9:29

Back to /b/, ``GNAA Faggot''

Name: Anonymous 2010-12-17 1:28

Xarn is a bad boyfriend

Name: Anonymous 2012-11-25 14:11

Name: Anonymous 2012-11-25 14:33

>>24
Did you use Labia Cleaver's cheeseburger rounding algorithm?

Name: Anonymous 2012-11-25 14:43

>>29
I was about to say that, fagshit.

Name: Anonymous 2012-11-25 14:48

>>29,30
I refrained from posting it, imbeciles.

Name: Anonymous 2012-11-25 15:10

1  Name: Anonymous : 2009-12-16 12:05
28  Name: Anonymous : 2012-11-25 14:11
stanley resurrects another dead thread.

Don't change these.
Name: Email:
Entire Thread Thread List