We present a Las Vegas algorithm which, for a given black-box group known to be isomorphic to a symmetric or alternating group, produces an explicit isomorphism with the standard permutation representation of the group. This algorithm has applications in computations with matrix groups and permutation groups. In this paper, we handle the case when the degree
of the standard permutation representation is part of the input. In a sequel, we shall treat the case when the value of
is not known in advance. As an important ingredient in the theoretical basis for the algorithm, we prove the following result about the orders of elements of
: the conditional probability that a random element
is an
-cycle, given that
, is at least
.