Jelly, 26 25 bytes
2ṗ⁵’µ×“wØ][:koR¶{‘^/=µÐfḢ
Takes input as a 7-bit integer. Returns the binary form of a 10-bit integer.
This just brute forces all possibilities. Remove the Ḣ
to get all possible outputs or replace it with an X
to get a random possible output.
###How it works 2ṗ⁵’µ×“wØ][:koR¶{‘^/=µÐfḢ - main link, takes one integer 2ṗ⁵’ - generate all length-10 binary arrays µ µÐf - now we find those arrays which correspond to digit- sequences which work to switch off all segments: Filter (keep) those arrays which: × - multiplied by “wØ][:koR¶{‘ - [119, 18, 93, 91, 58, 107, 111, 82, 127, 123] (encoding for turned-on segments given number) ^/ - reduced by XOR = - are equal to (implicit) the program's input Ḣ - output the first of these valid arrays
How it works
2ṗ⁵’µ×“wØ][:koR¶{‘^/=µÐfḢ - main link, takes one integer
2ṗ⁵’ - generate all length-10 binary arrays
µ µÐf - now we find those arrays which correspond to digit-
sequences which work to switch off all segments:
Filter (keep) those arrays which:
× - multiplied by
“wØ][:koR¶{‘ - [119, 18, 93, 91, 58, 107, 111, 82, 127, 123]
(encoding for turned-on segments given number)
^/ - reduced by XOR
= - are equal to (implicit) the program's input
Ḣ - output the first of these valid arrays