Monte Carlo simulation of radiative transfer in scattering, emitting, absorbing slab with gradient index