Implement Entombed's lookup table
Jelly, 21 19 15 bytes
ị“£ṅ@kṃżF’b3¤BX

Try it online!
-4 bytes after inspiration from @Neil's Charcoal Answer (binary!).
Try all testcases listed out in a grid (each row is one input tested multiple times).
How?
ị“£ṅ@kṃżF’b3¤BX     # Main link
 “©½B.ọṅc’                # The integer 1719989029560350
          b3              # to base 3: [1,1,2,0,0,2,2,1,1,1,1,2,0,0,0,1,1,1,2,0,0,0,0,2,0,1,2,2,0,0,0,1]
                          # (2 =&gt; R; 1 =&gt; 1; 0 =&gt; 0)
ị           ¤             # Index the input into the base 3 list above
                            # (1-indexed, and 0 gives the last element)
             B            # convert to binary: 2 =&gt; [0,1], 1 =&gt; [1], 0 =&gt; [0]
              X           # Pick a random element from that list


19 byte version
(I personally like this one more because it uses special properties of ị and X)
Try it online!
Try all testcases.
ị“©½B.ọṅc’b3¤Hị1,0X     # Main link
 “©½B.ọṅc’                # The integer 1719989029560350
          b3              # to base 3: [2,2,1,0,0,1,1,2,2,2,2,1,0,0,0,2,2,2,1,0,0,0,0,1,0,2,1,1,0,0,0,2]
                          # (2 =&gt; 1; 1 =&gt; R; 0 =&gt; 0)
ị           ¤             # Index the input into the base 3 list above
                            # (1-indexed, and 0 gives the last element)
             H            # Halve: [2,1,0] =&gt; [1,0.5,0]
              ị1,0        # Index into 1,0 (again 1-indexed)
                            # 1 gives 1, and 0 gives 0
                            # 0.5 gives [0,1]; since it is a fractional index, it gives both the element corresponding to floor(0.5) and ceil(0.5)
                  X       # Random; 3 different functions
                            # 0 =&gt; 0
                            # 1 =&gt; random integer from 1 to 1 =&gt; 1
                            # [0,1] =&gt; random element of [0,1]