A method of inference for a capture-recapture experiment in discrete time with variable capture probabilities