Follow

latex, code, academia 

Algorithms-in-maths people: Is there a good way of replacing lines 7-11 in attached image? I want to store all y:=f(x) that satisfy some property over all x in X, but also for each y found, the largest value of g(x). Lines 7-11 seem excessively obvious and distracting

· · Web · 2 · 2 · 1

latex, code, academia 

@w_pettersson
Wow, I hadn't seen Latex used like this before! Very cool!

latex, code, academia 

@w_pettersson Line 8 can be moved out of the if guard, since union is idempotent

can you initially let R(x) = -\infty ? or = 0 if g(y) is nonnegative? if so, then you can drop line 9 and move 11 out of the guard too!

latex, code, academia 

@lm Moving line 8 out and after the If is an idea, not 100% sure it makes the idea of the algorithm easier to follow though.

Initialising R(y) is what I want to do. However, I don't a priori know what S will be, soI'm not sure how to initialise R(y) in a way that actually makes the algorithm easier to follow.

latex, code, academia 

@w_pettersson if there's an "obvious" "smallest possible value" you can initialize R(y) to, then the max and union operations both follow the same pattern, to my eye

(I've spent a lot of thought on Haskell, so monoidal operations like that feel straightforward, but that may be different for other folks)

Sign in to participate in the conversation
Scholar Social

Scholar Social is a microblogging platform for researchers, grad students, librarians, archivists, undergrads, academically inclined high schoolers, educators of all levels, journal editors, research assistants, professors, administrators—anyone involved in academia who is willing to engage with others respectfully.