[Jprogramming] Combinations with Replacement
Raul Miller
rauldmiller at gmail.com
Tue May 10 04:51:11 UTC 2016
Does https://rosettacode.org/wiki/Combinations_with_repetitions#J_Alternate_implementation
satisfy this request?
Thanks,
--
Raul
On Tue, May 10, 2016 at 12:40 AM, Skip Cave <skip at caveconsulting.com> wrote:
> While we are discussing permutations and combinations....
>
> I haven't been able to find any mention in the J doc about a verb that
> gives all possible combinations with replacement.
>
> For example:
>
> 2 combr 1 2 3
>
> ┌───┬───┬───┬───┬───┬───┐
>
> │ 1 1 │ 1 2 │ 1 3 │ 2 2 │ 2 3 │ 3 3 │
>
> └───┴───┴───┴───┴───┴───┘
> 3 combr 1 2 3
>
> ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
>
> │ 1 1 1 │ 1 1 2 │ 1 1 3 │ 1 2 2 │ 1 2 3 │ 2 2 2 │ 2 2
> 3 │ 1 3 3 │ 2 3 3 │ 3 3 3 │
>
> └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
>
> Can someone point me to the right section of the J doc?
>
> Skip
>
> Skip Cave
> Cave Consulting LLC
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list