Skip to main content
added 389 characters in body
Source Link
Sp3000
  • 61.9k
  • 13
  • 115
  • 287

.NET flavour (52506 bytes)

Note: If you opened the regex within a few minutes of me posting this answer, I've changed the regex due to a last-minute bug. Sorry.

Subset sum, deluxe edition.

Regex here, expanded version here, tested on RegExLib and Regex Hero

Surely with these numbers there's a high chance that there's a unique solution, right? (statistically speaking)

 

Edit: Now that I think about it: 2256 is a lot of subsets, so that's probably false.

Match:1000010001000000001101011000001101110101001010011101000101010011011101000001010101001000010010000111011101100101001101001111000111010101100000101000101010110001010101001100100001110010001101010101100010110011000000110110000000011111101000001000011111100010

Mismatch: Huzzah for NP-complete regexes

This regex is one giant subset sum problem, and uses 16 groups to store data. Each 1 in the string represents 16 10-bit numbers, which together represent a 160-bit integer. The last few lines of the regex carry the values in the groups so that groups 2-16 go up to 1023 (e.g. 11023 + 1024 becomes 21023 + 1), as otherwise we'd only be solving 16 simultaneous mini subset sum problems as opposed to one big one.

.NET flavour (52506 bytes)

Note: If you opened the regex within a few minutes of me posting this answer, I've changed the regex due to a last-minute bug. Sorry.

Subset sum, deluxe edition.

Regex here, expanded version here, tested on RegExLib and Regex Hero

Surely with these numbers there's a high chance that there's a unique solution, right? (statistically speaking)

Edit: Now that I think about it: 2256 is a lot of subsets, so that's probably false.

.NET flavour (52506 bytes)

Subset sum, deluxe edition.

Regex here, expanded version here, tested on RegExLib and Regex Hero

 

Match:1000010001000000001101011000001101110101001010011101000101010011011101000001010101001000010010000111011101100101001101001111000111010101100000101000101010110001010101001100100001110010001101010101100010110011000000110110000000011111101000001000011111100010

Mismatch: Huzzah for NP-complete regexes

This regex is one giant subset sum problem, and uses 16 groups to store data. Each 1 in the string represents 16 10-bit numbers, which together represent a 160-bit integer. The last few lines of the regex carry the values in the groups so that groups 2-16 go up to 1023 (e.g. 11023 + 1024 becomes 21023 + 1), as otherwise we'd only be solving 16 simultaneous mini subset sum problems as opposed to one big one.

added 118 characters in body
Source Link
Sp3000
  • 61.9k
  • 13
  • 115
  • 287

.NET flavour (52506 bytes)

Note: If you opened the regex within a few minutes of me posting this answer, I've changed the regex due to a last-minute bug. Sorry.

Subset sum, deluxe edition.

Regex here, expanded version here, tested on RegExLib and Regex Hero

Surely with these numbers there's a high chanceSurely with these numbers there's a high chance that there's a unique solution, right? (statistically speaking)

Edit: Now that there'sI think about it: 2256 is a unique solution, right? (statistically speaking)lot of subsets, so that's probably false.

.NET flavour (52506 bytes)

Note: If you opened the regex within a few minutes of me posting this answer, I've changed the regex due to a last-minute bug. Sorry.

Subset sum, deluxe edition.

Regex here, expanded version here, tested on RegExLib and Regex Hero

Surely with these numbers there's a high chance that there's a unique solution, right? (statistically speaking)

.NET flavour (52506 bytes)

Note: If you opened the regex within a few minutes of me posting this answer, I've changed the regex due to a last-minute bug. Sorry.

Subset sum, deluxe edition.

Regex here, expanded version here, tested on RegExLib and Regex Hero

Surely with these numbers there's a high chance that there's a unique solution, right? (statistically speaking)

Edit: Now that I think about it: 2256 is a lot of subsets, so that's probably false.

added 213 characters in body
Source Link
Sp3000
  • 61.9k
  • 13
  • 115
  • 287

.NET flavour (5246752506 bytes)

Note: If you opened the regex within a few minutes of me posting this answer, I've changed the regex due to a last-minute bug. Sorry.

Subset sum, deluxe edition.

(sorry fixing)Regex here, expanded version here, tested on RegExLib and Regex Hero

Surely with these numbers there's a high chance that there's a unique solution, right? (statistically speaking)

.NET flavour (52467 bytes)

Subset sum, deluxe edition.

(sorry fixing)

Surely with these numbers there's a high chance that there's a unique solution, right? (statistically speaking)

.NET flavour (52506 bytes)

Note: If you opened the regex within a few minutes of me posting this answer, I've changed the regex due to a last-minute bug. Sorry.

Subset sum, deluxe edition.

Regex here, expanded version here, tested on RegExLib and Regex Hero

Surely with these numbers there's a high chance that there's a unique solution, right? (statistically speaking)

Source Link
Sp3000
  • 61.9k
  • 13
  • 115
  • 287
Loading