Digits with subsets of unique population size
Output a sequence of digits, with no 2 subsets of the digits 0 to 9 having equal population size.
Input
There is no input for this challenge.
Output
- A finite sequence of digits from
0123456789. - The output must be deterministic (the same sequence every time the code is run). You may use a pseudorandom number generator provided it results in the same sequence every run.
- The members of each subset of the digits
0to9must be present a different number of times. That is, with a different population size. - It follows that every digit must be present in the sequence at least once.
- Your sequence may be of any type that supports more than 1 instance of each digit. The examples use a string of digits.
Examples
Population size not unique per digit
0123456789
The digits each have equal population size. For example:
- The number of
0s is 1. - The number of
1s is 1.
So code that results in this sequence is not valid.
Population size unique per digit but not per subset
0112223333444445555556666666777777778888888889999999999
Every digit appears a unique number of times. There is 1 0, 2 1s, 3 2s, and so on. However, some subsets have equal population size. For example:
- There is 1
0and 43s, so the population of0s and3s has size 5. - There are 2
1s and 32s, so the population of1s and2s also has size 5.
So code that results in this sequence is not valid.
Test cases?
Every answer may take a different approach, so there can be no set test cases.
There are 1024 possible subsets of the digits 0 to 9. In working on your own answer or deciding how to vote on another answer, you can paste a string into [ THIS PAGE - TODO ] to see the population size for each of the 1024 subsets, sorted by population size, along with an indication of any which are identical.
Scoring
This is a code golf challenge. Your score is the number of bytes in your code. Lowest score for each language wins.
Explanations are optional, but I'm more likely to upvote answers that have one.

0 comment threads