Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Sandbox

Digits with subsets of unique population size

+0
−0

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 0 to 9 must 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 0 and 4 3s, so the population of 0s and 3s has size 5.
  • There are 2 1s and 3 2s, so the population of 1s and 2s 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.

History

0 comment threads