Entropy of semipatterns or how to connect the dots to minimize entropy