Write tile probability function