The relationship between n_permutations and exact test in permutation test

i just try to do permutation test for a small sample data, so i choose permutation test. But actually after i set n_permutations = 1000, it will told me ‘permuting 31 times (exact test)’. So could anybody tell me what does exact test mean, and why it just permutates 31 times. In my knowledge, 1000times are ok in permutation test, even the data is from small sample like 5

The cluster based permutation test implementation in mne-python sees that in your case the number of unique permutations is less than 1000, so it performs only that much. I agree that this is surprising, so an information about this should be printed. Feel free to open an issue on the github issue tracker asking for this clarification.

Thanks, so if i do 1000 permutation for my 5 sample data , the permutations in my test will be repeated used, then it maybe produces some false results, right? I see the problem, really appreciate your help :cowboy_hat_face:

Yes, if the number of samples is small you don’t have to approximate the permutation distribution via Monte Carlo (random draws), bacause you can check every possible permutation. As you say, doing it randomly you risk repeating the draws.