instead of generating all ST's just generate N by random sampling