Here is a very small casino, or the mecanism of random.
Simple to understand : you pay one item and may gamble one other item. The chance you have to win is your choice : 1/2 to 1/81 chances to win ! To chose it, you have to add some "carpets" (each of differents colors) in dispensers to downgrade the loot ratio.
To chose the item required, replace the first item of the first hopper (near the comparator) with one of your choice.
See you soon for more Casino Machine !
Good Luck & Have Redstone !