This trace adds some clarity, too.
trace'3(+*-(*+-)(+-*))4'
--- 5 Trident
+
-
*
+ - *
--- 8 Paren --
(
+ - *
)
+ - *
--- 5 Trident
*
+
-
* + -
--- 8 Paren --
(
* + -
)
* + -
--- 5 Trident
-
[mailto:
> programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller
> Sent: Saturday, July 19, 2014 9:15 PM
> To: Programming forum
> Subject: Re: [Jprogramming] High Speed Train Challenge
>
> J's trace facility should make the answer to this question obvious?
>
> Thanks,
&g
That shows pretty clearly, in my opinion, which parenthesis are
redundant, and why.
You'd need to compare it with the trace of the other expression to see
the difference, of course.
That said, Joe Bogner's post on how to see the intermediate results
during an execution of that train gives another
Yes, well, the trace:
trace'3(***(***)(***))4'
--- 5 Trident
*
*
*
* * *
--- 8 Paren --
(
* * *
)
* * *
--- 5 Trident
*
*
*
* * *
--- 8 Paren --
(
* * *
)
* * *
--- 5 Trident
*
* * *
* *
This may also help show the evaluation more clearly:
nb =: (;:^:_1) @: (":&.>)
m=: 4 : 'x*y[smoutput nb y;''*'';x'
3 (m m m (m m m) m m m) 4
4 * 3
4 * 3
12 * 12
4 * 3
144 * 12
144 * 12
1728 * 1728
4 * 3
2985984 * 12
35831808
3 ((m m m) (m m m) m m m) 4
4 * 3
4 * 3
12 * 12
4 * 3
4 * 3
12 * 12
14
I would explain it by quoting a few sentences from the dictionary
Execution proceeds from right to left, except that when a right parenthesis
is encountered... in an unparenthesized expression the right argument of
any verb is the result of the entire phrase to its right... The executions
in the s
Linda is using a verizon.net email address, so is probably not using
gmail, and probably not using a browser-based email address.
A quick web search suggests that verizon provides a simplified version
of microsoft exchange.
FYI,
--
Raul
On Sun, Jul 20, 2014 at 12:34 AM, Brian Schott wrote:
>
forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Erling Hellenäs
Sent: Sunday, July 20, 2014 5:24 AM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] High Speed Train Challenge
3(***(***)(***))4
35831808
3((***))4
144
3(***(***)144"_)4
35831808
3(*)
mming forum
Subject: Re: [Jprogramming] High Speed Train Challenge
I am not familiar with VHIS; that is, I don't know what it is.
I use gmail for my email. I think it was Raul who posted a tip to the
forums that with gmail you can get a better copy/paste if instead of Paste
you use Paste
sing APL, an idea might come to mind.
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of 'Pascal
Jasmin' via Programming
Sent: Saturday, July 19, 2014 8:34 PM
To: programm...@jsoftware.com
Subject: R
I am not familiar with VHIS; that is, I don't know what it is.
I use gmail for my email. I think it was Raul who posted a tip to the
forums that with gmail you can get a better copy/paste if instead of Paste
you use Paste and Match Style.
You may not have access to Paste and Match Style in your e
rds?
>
> -Original Message-
> From: programming-boun...@forums.jsoftware.com
> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller
> Sent: Saturday, July 19, 2014 9:15 PM
> To: Programming forum
> Subject: Re: [Jprogramming] High Speed Train Challeng
> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of 'Pascal
> Jasmin' via Programming
> Sent: Saturday, July 19, 2014 8:34 PM
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] High Speed Train Challenge
>
>
>
> 3 * utu utu 4
>
>3 *
Subject: Re: [Jprogramming] High Speed Train Challenge
I'm still looking for the phrase or concept that explains the difference
between these two. Why are they producing different results?
3(***(***)(***))4
35831808
3((***)(***)***)4
429981696
If you grew up in the early years
-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Brian Schott
Sent: Saturday, July 19, 2014 11:46 PM
To: Programming forum
Subject: Re: [Jprogramming] High Speed Train Challenge
Linda, does your tree display explain the difference for
: Saturday, July 19, 2014 11:46 PM
To: Programming forum
Subject: Re: [Jprogramming] High Speed Train Challenge
Linda, does your tree display explain the difference for you?
I have tried to show what I mean with trees. The only word that may be
missing is "isolated": Trains are isolated se
Linda, does your tree display explain the difference for you?
I have tried to show what I mean with trees. The only word that may be
missing is "isolated": Trains are isolated sequences of verbs, and
parentheses pairs can induce isolation. In the first example the first 3
stars are forced into a si
1 : '[: u~ u' 1 : '[: u~ u' 4
> > 429981696
> >
> >
> >
> > - Original Message -
> > From: Kip Murray
> > To: "programm...@jsoftware.com"
> > Cc:
> > Sent: Saturday, July 19, 2014 6:55:02 PM
> > Subject:
ramming-boun...@forums.jsoftware.com] On Behalf Of 'Pascal
> Jasmin' via Programming
> Sent: Saturday, July 19, 2014 8:34 PM
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] High Speed Train Challenge
>
>
>
> 3 * utu utu 4
>
>3 * 1 : '[: u~
: [Jprogramming] High Speed Train Challenge
utu =: 1 : '[: u~ u'
3 *:@* utu 4
429981696
uses the ideas that *** is equivalent to *:@* and u u u is equivalent to [:
u~ u
On Saturday, July 19, 2014, 'Pascal Jasmin' via Programming <
programm...@jsoftware.com> wrote:
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of 'Pascal
Jasmin' via Programming
Sent: Saturday, July 19, 2014 8:34 PM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] High Speed Train Challenge
gramm...@jsoftware.com
Subject: Re: [Jprogramming] High Speed Train Challenge
Nice.
3([: *~(^:3) *)4 NB. Recursive way via Pascal Jasmin
429981696
Any more funny ways to do this?
/Erling
On 2014-07-19 23:59, 'Pascal Jasmin' via Programming wrote:
&
3 * utu utu 4
3 * 1 : '[: u~ u' 1 : '[: u~ u' 4
429981696
- Original Message -
From: Kip Murray
To: "programm...@jsoftware.com"
Cc:
Sent: Saturday, July 19, 2014 6:55:02 PM
Subject: Re: [Jprogramming] High Speed Train Challenge
utu =:
That has a symmetric charm!
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Erling Hellenäs
Sent: Saturday, July 19, 2014 3:05 PM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] High Speed
>
> To: programm...@jsoftware.com
> Cc:
> Sent: Saturday, July 19, 2014 6:16:58 PM
> Subject: Re: [Jprogramming] High Speed Train Challenge
>
> Hi Pascal,
>
> Not arguing against the idea but they are only functionally the same for
> monadic.
>
>4 *: 4
> |domain
t: Saturday, July 19, 2014 6:16:58 PM
Subject: Re: [Jprogramming] High Speed Train Challenge
Hi Pascal,
Not arguing against the idea but they are only functionally the same for
monadic.
4 *: 4
|domain error
| 4 *:4
4 +: 4
|domain error
| 4 +:4
5 *: 4
|domain error
| 5 *
Nice.
3([: *~(^:3) *)4 NB. Recursive way via Pascal Jasmin
429981696
Any more funny ways to do this?
/Erling
On 2014-07-19 23:59, 'Pascal Jasmin' via Programming wrote:
*~(^:3) 12
--
For information about J forums se
dic +: and *: were
> redefined considering that +~ and *~ do the same?
>
>
> - Original Message -
> From: Erling Hellenäs
> To: programm...@jsoftware.com
> Cc:
> Sent: Saturday, July 19, 2014 3:05:03 PM
> Subject: Re: [Jprogramming] High Speed Train Challenge
>
: Erling Hellenäs
To: programm...@jsoftware.com
Cc:
Sent: Saturday, July 19, 2014 3:05:03 PM
Subject: Re: [Jprogramming] High Speed Train Challenge
Another way to do the same thing, but not a solution, is this expression:
3 (*(*(***)*)*) 4 NB. Funny way
429981696
Anyone can find a nice
Another way to do the same thing, but not a solution, is this expression:
3 (*(*(***)*)*) 4 NB. Funny way
429981696
Anyone can find a nice recursive way to write it? My best shot:
12 1:`([ * [ $: [: <: ])@.([: * ]) 8 NB. Complicated way
429981696
It's a recursion? * $: *
/Erling
On 20
ithout affecting the pattern:
>> >
>> > Linda
>> >
>> > -Original Message-
>> > From: programming-boun...@forums.jsoftware.com
>> > [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Erling
>> > Hellenäs
>> > Sent: Saturda
t; > Hellenäs
> > Sent: Saturday, July 19, 2014 9:42 AM
> > To: programm...@jsoftware.com
> > Subject: Re: [Jprogramming] High Speed Train Challenge
> >
> > 3(***(***)(***))4 NB. Challenge
> > 35831808
> > 3(*(***)(***))4 NB. Solution
> > 429981696
ilto:programming-boun...@forums.jsoftware.com] On Behalf Of Erling
> Hellenäs
> Sent: Saturday, July 19, 2014 9:42 AM
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] High Speed Train Challenge
>
> 3(***(***)(***))4 NB. Challenge
> 35831808
> 3(*
...@jsoftware.com
Subject: Re: [Jprogramming] High Speed Train Challenge
3(***(***)(***))4 NB. Challenge
35831808
3(*(***)(***))4 NB. Solution
429981696
3((***)(***)***)4 NB. Verify against
429981696
3([: <. 0.5 + * ^ 8:)4 NB. Other expression with same result
429981696
3 (* *^:8 1:) 4
Challenge accepted:
3(42981696"_***(***)(***))4
42981696
What?
42981696"_ is one verb, isn't it?
Thanks,
--
Raul
On Sat, Jul 19, 2014 at 6:33 AM, Linda Alvord wrote:
> Here is the rule:
>
>
>
> You may only insert one verb as many times as you wish anywhere in the
> expression to prod
3(***(***)(***))4 NB. Challenge
35831808
3(*(***)(***))4 NB. Solution
429981696
3((***)(***)***)4 NB. Verify against
429981696
3([: <. 0.5 + * ^ 8:)4 NB. Other expression with same result
429981696
3 (* *^:8 1:) 4 NB. Other expression with same result
429981696
3 (*
Here is the rule:
You may only insert one verb as many times as you wish anywhere in the
expression to produce the desired result:
3()4
3
3(%**%%*%)4
16
Here is the desired result:
3((***)(***)***)4
429981696
Here is the expression you must modify to gene
37 matches
Mail list logo