python vs octave random generator
问题 More specifically, numpy: In [24]: a=np.random.RandomState(4) In [25]: a.rand() Out[25]: 0.9670298390136767 In [26]: a.get_state() Out[26]: ('MT19937', array([1248735455, ..., 1532921051], dtype=uint32), 2,0,0.0) octave: octave:17> rand('state',4) octave:18> rand() ans = 0.23605 octave:19> rand('seed',4) octave:20> rand() ans = 0.12852 Octave claims to perform the same algorithm (Mersenne Twister with a period of 2^{19937-1}) Anybody know why the difference? 回答1: Unfortunately the MT19937