jlink / shrinking-challenge

Comparing shrinking approaches and performance across different PBT libraries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fermat primes challenge

kostis opened this issue · comments

I propose the following (simple/fun) challenge to be added.

Fermat primes are primes of the form 2^(2^N) + 1. According to Wikipedia, as of August 2019, the only known Fermat primes are 3, 5, 17, 257 and 65537. Also, the probability of existence of another Fermat prime is less than one in a billion.

The challenge is to reliably falsify (and then shrink) the following property. Any set of positive integers (alternatively, set of integers in the range [3,1000000]) contains at most 2 Fermat primes.

In most PBT tools, the easiest way to represent sets is via lists of positive integers (integers in the above range) where duplicates are removed (perhaps via sorting).

The minimum counterexample is [3,5,17] (or some permutation of it if represented as a set).

Measure:

  1. How often / how fast your tool finds a counterexample.
  2. How many attempts / evaluations it takes to shrink these.

Important: It is not allowed to cheat by generating lists/sets of primes or integers of the form 2^(2^N) + 1 only.

Sounds cool. Would love to try.

@kostis I invited you as a collborator since I'll be on vacation for two weeks without access to a "real" computer. Feel free to add it.