Statistical mechanics of binary systems