Optimal bounds for the distributions of some test criteria for tests of dimensionality