On Jun 3, 2009, at 11:23 PM, CuppoJava wrote:
> > Hey guys, > I'm really stuck on this math question, and I'm wondering if you guys > know of any links that may help me. > > Given: f(x,y), a0, a list of numbers v. > Find: g(x,y) and b0 such that: > > (reduce f a0 v) = (reduce g b0 (reverse v)) > > Thanks for your help What math class is this for and what have you been studying lately in it? :) I couldn't think of any fundamental functions that aren't commutative besides - and /, which turn out to work like commutative functions if you use ao = bo. My first thought was that if I had a really nasty function I could maybe use 'flip' to fix it: (defn flip [f] (fn [one two] (f two one))) This turned out to be useless. (I was trying with f = #(+ (* %1 %1) (/ %1 %2)) ). No combination of flip + first/last could make [1 2 3 4 5] and [5 4 3 2 1] come out with the same answer that I could see. I am quite curious what the final answer turns out to be but I couldn't come up with it in the ~20 minutes I spent on it. Let us know when you figure it out! — Daniel Lyons http://www.storytotell.org -- Tell It! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---