Re: [Jprogramming] Limit from the right

2013-02-28 Thread km
I remember that comparisons with 0 are exact 0 = N - N + epsilon 0 0 0 0 0 0 0 1 1 which agrees with your first report. No, I am unfamiliar with the IEEE structure, and am surprised by these results. --Kip Sent from my iPad On Feb 28, 2013, at 4:21 PM, Raul Miller wrote: > Are you fa

Re: [Jprogramming] alternating application of monads

2013-02-28 Thread Johann Hibschman
Thanks, that's interesting. It seems a little cumbersome, but it certainly works. It seems to do a lot of appending, but since it's continually building up the series, it never duplicates work. It can only do odd-length output sequences, but the even sequences are only a }: away. On Thu, Feb 28,

Re: [Jprogramming] Limit from the right

2013-02-28 Thread Raul Miller
Are you familiar with the structure of IEEE 754 floating point numbers? Consider, for example: epsilon=: 2^_44 N=: 10^i:4 NB. this result reflects IEEE-754's structure *N+epsilon-N 1 1 1 1 1 1 1 0 0 NB. this result reflects J's heuristic to deal with that structure N=N+epsilon

Re: [Jprogramming] Limit from the right

2013-02-28 Thread km
Here is what I did NB. right hand limit of a function lim =: 1 : 0 value =. u y + (2^_44) if. value <: - 2^40 do. __ elseif. value >: 2^40 do. _ elseif. do. value end. ) It does "reasonably well" but can be fooled, for example ] lim 2^40 _ Here it does better *: lim

Re: [Jprogramming] The farmer's fence

2013-02-28 Thread Jose Mario Quintana
Kip in http://www.jsoftware.com/pipermail/programming/2013-February/031712.htmlpresented the argument assuming that the square is perimeter-area optimal for the rectangular polygons. The question is: can one show the implicit assumption without calculus? I think so: one only has to show that x=c

Re: [Jprogramming] alternating application of monads

2013-02-28 Thread Raul Miller
Here's one approach: (, (, +:)@>:@{:)^:3]1 1 2 4 5 10 11 22 -- Raul On Thu, Feb 28, 2013 at 10:26 AM, Johann Hibschman wrote: > How do you generate a series produced by alternate application of two > monads? > > For example, if I alternate >: and +: starting from 1, I get: > > 1 2 4 5 1

[Jprogramming] alternating application of monads

2013-02-28 Thread Johann Hibschman
How do you generate a series produced by alternate application of two monads? For example, if I alternate >: and +: starting from 1, I get: 1 2 4 5 10 11 22 ... I can generate every other item in the series via (+:@>:)^:(i.6) 1, and I get close with (([: >: ])`([: +: ]))/\6#1, but the orderi

Re: [Jprogramming] Limit from the right

2013-02-28 Thread Raul Miller
Here's a model implementation: lim=: (1 :0)("0) tests=. u ((1e_6*1>.|y)*0.5^i.1000)+y tests {~{.I.((1 }. 0&~:) * 2 ~:/\ ])(,2:)(*!.0)2 -/\ tests ) My assumptions are: (1) the limit in question is relatively stable (that my choices for epsilon are adequate) (2) that the result of limit sh