The source code and dockerfile for the GSW2024 AI Lab.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

34 lines
745 B

4 weeks ago
  1. // Knuth's model of a fair die using only fair coins
  2. dtmc
  3. const double p;
  4. module die
  5. // local state
  6. s : [0..7] init 0;
  7. // value of the dice
  8. d : [0..6] init 0;
  9. [] s=0 -> p : (s'=1) + (1-p) : (s'=2);
  10. [] s=1 -> p : (s'=3) + (1-p) : (s'=4);
  11. [] s=2 -> p : (s'=5) + (1-p) : (s'=6);
  12. [] s=3 -> p : (s'=1) + (1-p) : (s'=7) & (d'=1);
  13. [] s=4 -> p : (s'=7) & (d'=2) + (1-p) : (s'=7) & (d'=3);
  14. [] s=5 -> p : (s'=7) & (d'=4) + (1-p) : (s'=7) & (d'=5);
  15. [] s=6 -> p : (s'=2) + (1-p) : (s'=7) & (d'=6);
  16. [] s=7 -> 1: (s'=7);
  17. endmodule
  18. rewards "coin_flips"
  19. [] s<7 : 1;
  20. endrewards
  21. label "one" = s=7&d=1;
  22. label "two" = s=7&d=2;
  23. label "three" = s=7&d=3;
  24. label "four" = s=7&d=4;
  25. label "five" = s=7&d=5;
  26. label "six" = s=7&d=6;
  27. label "done" = s=7;