Differences between revisions 3 and 4
 ⇤ ← Revision 3 as of 2007-10-12 23:16:31 → Size: 1172 Editor: RogerHui Comment: see also ← Revision 4 as of 2008-12-08 10:45:29 → ⇥ Size: 1175 Editor: anonymous Comment: converted to 1.6 markup Deletions are marked like this. Additions are marked like this. Line 19: Line 19: [[TableOfContents(2)]] <> Line 60: Line 60: [[BR]] <
> Line 63: Line 63: * [:Essays/Index in Nub:Index in Nub] * [[Essays/Index in Nub|Index in Nub]] Line 65: Line 65: [[BR]] <
> Line 67: Line 67: Contributed by RogerHui. This text expands on the ideas discussed in the [http://www.jsoftware.com/pipermail/programming/2007-October/008378.html J Forum] Contributed by RogerHui. This text expands on the ideas discussed in the [[http://www.jsoftware.com/pipermail/programming/2007-October/008378.html|J Forum]]

It is not true in general that (x i. y) -: (~.x) i. y :

```   x=: 50 ?.@\$ 10
y=: 20 ?.@\$ 10
x i. y
0 1 2 3 4 2 6 7 6 4 0 11 12 11 14 3 11 6 6 3
(~.x) i. y
0 1 2 3 4 2 5 6 5 4 0 7 8 7 9 3 7 5 5 3```

Under what conditions would  (x i. y) -: (~.x) i. y be true?

Solutions

Contents

## No Duplicates

The proposition holds if x -: ~.x .

```   x=: 50 ?.@\$ 1e6
y=: (5 ?@\$ #x){x
x -: ~. x
1
x i. y
40 47 8 29 22
(~.x) i. y
40 47 8 29 22```

## 0 Items

The proposition holds if y (or x) has 0 items.

```   x=: 50 ?.@\$ 10
y=: i. 0
(x i. y) -: (~.x) i. y
1```

## Prefix

The proposition holds if all items of y occur in a prefix of x that has distinct items.

```   x=: (20?.20) , 100 ?.@\$ 20
y=: 5 ?.@\$ 20
x i. y
0 3 2 8 5
(~.x) i. y
0 3 2 8 5```