A school tries a new way of running revision sessions. Five students get the new format (group A), five get the usual one (group B), and everyone sits the same quiz. Group A scores higher on average, but with only ten students, could a gap that size be luck?
A permutation test answers this without any formula for the sampling distribution. Under the null hypothesis the format makes no difference, so the labels "A" and "B" are arbitrary: any five of the ten scores could just as easily have been the group-A five. That gives a recipe:
Shuffling the labels at random many times would sample from exactly this list of relabellings. With small groups you can try them all instead, so the answer does not depend on luck.
Task: write permutation_test(group_a, group_b) that returns the tuple (d_obs, p_value), both rounded to 4 decimal places.
Once your code passes every test, a reference solution shows up here so you can compare it with yours.