A stochastic approximation method for optimizing a class of discrete functions is considered. The procedure is a version of the simultaneous perturbation stochastic approximation (SPSA) method that has been modified to obtain a stochastic optimization method for cost functions defined on a grid of points in Euclidean p-space having integer components. We discuss the algorithm and examine its convergence properties.