Open tangentstorm opened 2 years ago
the 'better inverse' doesn't work; u`v`w} y is (v y)} w y, not (u y) (v y)} w y. An alternative: <:@#/.\~@(,\~ i.@>:@(>./))
(or parenthesise #/.~ for juicier numbers—w/e)
An alternative: <:@#/.\~@(,~ i.@>:@(>./))
This is nice, and appears to mirror what BQN (/⁼)
does.
Dyalog (⍸⍣¯1)
will DOMAIN ERROR
on non-monotonic lists, which is less helpful (but likely allows them to optimise for the sorted case)
Marshall suggests that:
The verb
((#/.~@])`(~.@])`[})
with an appropriate left argument is an left inverse toI.
ignoring trailing zeros, and a right inverse toI.
ignoring ordering. It counts, for each number in (i.n
) wheren
is the length of the left argument, how many elements on the right are equal to it.In that form, the inverse would be a dyad, which would prevent its use in duals. Perhaps a better inverse is
((#/.~)`~.`(0#~>:@(>./))})
.-- @HenryHRich 22:38, 27 June 2017 (UTC)