Re: [Jprogramming] Derivatives

2020-02-06 Thread Lippu Esa
Hello Brian and others, After finding the first root x1 you can deflate the original equation by dividing it by (x-x1) . Esa load'math/calculus' Newton =: adverb : ']-u%(u deriv_jcalculus_ 1)'(^:_)("0) (+:-^~) Newton 0.5 0.346323 ((+:-^~)%-&0.346323) Newton 1 2 -Original Message--

Re: [Jprogramming] Derivatives

2020-02-06 Thread Skip Cave
]x=.i:3 _3 _2 _1 0 1 2 3 0^x _ _ _ 1 0 0 0 x=.0 (x^x)=2*x 0 NB. Zero is not a root (x^x)=2*x 0 x^x 1 2*x 0 So why does Newton Raphson show a zero root for (x^x)=2*x? (^~ - +:) Newton 2 2 (^~ - +:) Newton 1 0 NB. Something wrong here! (x^x)=2*x ? Skip Cave Cave Consulting LLC

Re: [Jprogramming] ? and ?.

2020-02-06 Thread bill lam
Android with armv7 cpu are 32 bit, with armv8 cpu are 64 bit. They give different results for RNG. 32 vs 64 bit can be checked by the global noun IF64 On Thu, Feb 6, 2020, 9:18 PM 'Rob Hodgkinson' via Programming < programm...@jsoftware.com> wrote: > Hi Arnab, further to Pascal’s note I would

Re: [Jprogramming] Derivatives

2020-02-06 Thread Don Kelly
Bo is correct There is a "zero rule"  so n^0 =1 if n is not equal to 0. Bo is correct the only possible 0^0 is the same as 0*0 Possibly the coding for ^ should take this into account. On 2020-02-05 10:14 p.m., Skip Cave wrote: Bo, The original equation is: (x^x)=2*x 2 is clearly a root. 0 i

Re: [Jprogramming] multiply two multidimensional matrices

2020-02-06 Thread Henry Rich
+/ . * is so much faster than (+/@:(*"1 _)) that even if you were given a notation for selecting an axis, the implementation would do the transpose so that it could use the faster product. +/@:*"1  is pretty fast for small arguments but for big ones its cache characteristics mean you end up li

Re: [Jprogramming] multiply two multidimensional matrices

2020-02-06 Thread rsykora
February 6, 2020 11:00 PM, "Henry Rich" wrote: > It's not so simple to describe. In fact, you haven't described it. > Your example seems to have a rank-4 array times a rank-5 array producing > a rank-7 array. Is this result the sum of rank-7 arrays created by > multiplying rank-3 times rank

Re: [Jprogramming] multiply two multidimensional matrices

2020-02-06 Thread Marshall Lochbaum
Here is a way to permute the axes of an array that you might find easier to work with: A =. i. 2 3 4 5 $ ('ijkl'i.'ljik') |: A 5 3 2 4 The idea is that we start with A, which has axes ijkl, and want to shuffle them around to get ljik. So we look up each of the letters ljik in ijkl, which gi

Re: [Jprogramming] multiply two multidimensional matrices

2020-02-06 Thread Raul Miller
It's simple mathematically, because you've already learned that and because you are willing to elide discussion of various mechanical details. Personally, I had to read your question a couple of times, and then Henry's response and then your question again to resolve some of the ambiguities. The

Re: [Jprogramming] multiply two multidimensional matrices

2020-02-06 Thread Henry Rich
It's not so simple to describe.  In fact, you haven't described it.  Your example seems to have a rank-4 array times a rank-5 array producing a rank-7 array.  Is this result the sum of rank-7 arrays created by multiplying rank-3 times rank-4?  I don't know how to make that jibe with 'the usual

Re: [Jprogramming] multiply two multidimensional matrices

2020-02-06 Thread rsykora
Henry Rich writes: > It depends on what the '*' means in the definition of the product. >> C_ijlmnop = sum_k A_ijkl * B_mknop I really mean the usual multiplication (of numbers). > Have a look at > > a =. i. 2 3 4 5 > b =. i. 2 4 3 5 6 > $ (2 |: a) +/ . * ((|:~ 1 -.~ i.@(#@$)) b) > 2 3 5 2 3

Re: [Jprogramming] multiply two multidimensional matrices

2020-02-06 Thread Henry Rich
It depends on what the '*' means in the definition of the product.  Have a look at    a =. i. 2 3 4 5    b =. i. 2 4 3 5 6    $ (2 |: a) +/ . * ((|:~   1 -.~ i.@(#@$)) b) 2 3 5 2 3 5 6 Henry Rich On 2/6/2020 2:46 PM, rsyk...@disroot.org wrote: Dear list, having two multidimensional matrices

[Jprogramming] multiply two multidimensional matrices

2020-02-06 Thread rsykora
Dear list, having two multidimensional matrices A and B, with some indices, say, A_ijkl and B_mknop, how can I obtain a matrix C, where C_ijlmnop = sum_k A_ijkl * B_mknop ie., C has all indices of A and B but for the index k, which was summed over. Thanks for your suggestions. Best regards Rud

Re: [Jprogramming] Derivatives

2020-02-06 Thread Skip Cave
solve: (x^x)=2*x JVERSION Engine: j901/j64avx2/windows Release-e: commercial/2020-01-29T11:17:19 Library: 9.01.18 Qt IDE: 1.8.5/5.12.6 Platform: Win 64 Installer: J901 install InstallPath: c:/users/skip/j901 Contact: www.jsoftware.com load 'math/calculus' Newton =: adverb : ']-u%(u der

Re: [Jprogramming] Logic programming

2020-02-06 Thread Raul Miller
I do not think that I said that 5!:5 produces erroneous results. I think I said that when non-nouns are involved that the result of 5!:5 may not be a suitable ". argument. Here's an example: example=:3 :0 a=:'this' b=:a,' is a' b,y ) With that definition, this works: example i.0 B

Re: [Jprogramming] ? and ?.

2020-02-06 Thread Henry Rich
2.   ? (1 | <. 1000 * 6!:1 '') # 0 Henry Rich On 2/6/2020 7:21 AM, Arnab Chakraborty wrote: Dear all, For my class of about 30 students armed with JAndroid 901, I had planned to use ?. to generate a random matrix which should be same for everybody. To start with, I asked everybody to try

Re: [Jprogramming] Derivatives

2020-02-06 Thread Henry Rich
1. Choose a different starting guess 2. Update the addon Henry Rich On 2/6/2020 10:36 AM, Brian Schott wrote: Henry et al, I have 2 questions. How would the second root at 2 be found with Skip's problem? Why do I get the following error? server:~ brian$ /Users/brian/j901/bin/jconsole ; exit

Re: [Jprogramming] NULL in an integer array?

2020-02-06 Thread PMA
Yes, I can see that would track with minimal risk. Thank you. On 02/05/2020 10:38 PM, Devon McCormick wrote: The Boolean indicator vector sounds like a good way to handle this. On Wed, Feb 5, 2020 at 2:33 PM Don Guinn wrote: Yes. I just wanted to make sure he was aware that that would happe

Re: [Jprogramming] Derivatives

2020-02-06 Thread Brian Schott
Henry et al, I have 2 questions. How would the second root at 2 be found with Skip's problem? Why do I get the following error? server:~ brian$ /Users/brian/j901/bin/jconsole ; exit; JVERSION Engine: j901/j64avx/darwin Release-c: commercial/2020-01-11T12:22:31 Library: 9.01.20 Platform: Darwi

Re: [Jprogramming] ? and ?.

2020-02-06 Thread bill lam
?. should be stable but different result on J32 vs J64 J32 '89551d61c612f81fb7553a355bf932d2d8f78ed7' -: (128!:6) ": ?.#~1e6 J64 '6ebe83e54f37c4cdb3cfb617e657af9dd2074c42' -: (128!:6) ": ?.#~1e6 Thu, 06 Feb 2020, bill lam написал(а): > Strange, I got 94 on arm64. > > Did 32bits and 64bits get

Re: [Jprogramming] ? and ?.

2020-02-06 Thread bill lam
Strange, I got 94 on arm64. Did 32bits and 64bits get different results? On Thu, Feb 6, 2020, 8:21 PM Arnab Chakraborty wrote: > Dear all, > > For my class of about 30 students armed with JAndroid 901, I had planned to > use ?. to generate a random matrix which should be same for everybody. To

Re: [Jprogramming] ? and ?.

2020-02-06 Thread 'Rob Hodgkinson' via Programming
Hi Arnab, further to Pascal’s note I would suggest the following approach: Set the random seed for the RNG to a value you desire (see the Foreign Conjunction 9!:1 ) Then call ?n as you wish to produce a sequence as many times as you wish Repeat sequence above to reproduce from a p

Re: [Jprogramming] ? and ?.

2020-02-06 Thread 'Pascal Jasmin' via Programming
The initial seed is the same each time you start J. ?. differs on 32 and 64 bit systems, with default generator. On Thursday, February 6, 2020, 07:21:31 a.m. EST, Arnab Chakraborty wrote: Dear all, For my class of about 30 students armed with JAndroid 901, I had planned to use ?. to ge

[Jprogramming] ? and ?.

2020-02-06 Thread Arnab Chakraborty
Dear all, For my class of about 30 students armed with JAndroid 901, I had planned to use ?. to generate a random matrix which should be same for everybody. To start with, I asked everybody to try ?. 100 Some got 46, others got 93. No other values. Next, someone noticed that if they repeatedly t

Re: [Jprogramming] Android: whis is lowest version supported?

2020-02-06 Thread Arnab Chakraborty
The new version works perfectly with Android 5. Thanks a lot, Bill! On Tue, Feb 4, 2020 at 7:41 PM 'Sergey Kamenev' via Programming < programm...@jsoftware.com> wrote: > Now working! > > Thank you > > 04.02.2020 11:49, bill lam пишет: > > I can reproduce the crash on Android 5. It was some > > il

Re: [Jprogramming] Derivatives

2020-02-06 Thread bill lam
Write down the equation on paper and then use android mathway app to take a photo of it, and it solved x=0.34632336,2 -- regards, GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3 --