Skip to main content
15 events
when toggle format what by license comment
May 12, 2017 at 3:13 answer added kglr timeline score: 1
May 11, 2017 at 19:52 comment added george2079 Do we know b is all zero to begin with and what if it is not?
May 11, 2017 at 19:03 answer added nben timeline score: 3
May 11, 2017 at 19:01 answer added David G. Stork timeline score: 1
May 11, 2017 at 18:52 history edited David G. Stork CC BY-SA 3.0
edited title
May 11, 2017 at 18:18 comment added David G. Stork We need an "inverse golf" or "Rube Goldberg" contest for the most complex or inefficient code to solve a simple problem! Creativity gets points!
May 11, 2017 at 17:17 comment added webcpu MapIndexed[If[#1 > 2, #1, b[[First@#2]]] &, a]
May 11, 2017 at 17:16 comment added webcpu My solution is more complex. Thread[Complex[b, a]] /. Complex[x_, y_] /; y > 2 -> Complex[y, x] //Re
May 11, 2017 at 17:01 comment added David G. Stork My goodness: This is the most complicated "solution" one could imagine for such a trivial problem. Search "Rube Goldberg" to see an analogy.
May 11, 2017 at 16:49 history edited David G. Stork CC BY-SA 3.0
edited title
May 11, 2017 at 16:48 comment added Ali Hashmi not simple perhaps but works ! (b[[;; Length@Complement[a, #]]]~Join~#) &@SequenceCases[a, {pat : _?(# > 2 &)} :> pat]
May 11, 2017 at 16:11 comment added David Baghdasaryan Yeap, or alternative MapThread[If[#1 > 2, #1, #2] &, {a, b}]
May 11, 2017 at 16:10 comment added J. M.'s missing motivation b = a UnitStep[a - 3]?
May 11, 2017 at 16:06 history edited J. M.'s missing motivation
edited tags
May 11, 2017 at 16:06 history asked user1470393 CC BY-SA 3.0