# How to a sample of a time series of zeros and ones with given autocorrelation function?

Let's say, I have an autocorrelation function:

$$C(\text{lag}) = \text{lag}^{-\gamma}$$

How can I generate a sample of a time series of, say, $0$'s and $1$'s, such that their sample autocorrelation function matches the given one?

The given function is just an example. I am seeking a procedure for any autocorrelation function.

-