I have posted the topic once, but as recieved no reply, I am trying a little force, hope it ain't forbidden:-)
Ok, basing on Carl-Rubin theorem, it is easy to determine UMP test for testing H0: p<p1 or p2<p vs H1: p1<p<p2 where p1 and p2 are given probabilities. To test this at some significance level alpha, we repeat a Bernoulli scheme B(p) n times. In fact, for us to obtain a UMP test for H0 at the level alpha, we have to construct a randomized test, based on a statistic S being the number of successes. If S falls between x_a and x_b we decide to reject the Null Hypothesis. If S happens to be x_a or x_b, then we run another experiment and basing on its result we reject or accept H0.
I have coded all that in Maple, but still I dont think it is the best way one does it.
If you could modify my code, partialy or even completely, I'd appreciate it much... I dont like the subs parts of my code especially - I have tried to involve 'assign' somehow, but I am too much inexperienced to succeed in...
The code, which I really tried to enclose here, can be found as Testing H0 file uploaded