> For the complete documentation index, see [llms.txt](https://trueodds.gitbook.io/trueodds/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trueodds.gitbook.io/trueodds/dice-game/what-is-it.md).

# What is it?

By True Odds team.

## A tale as old as history

The existence of dices is extremely old, so old in fact, that their origin is completely uncertain. They have since become a part of our human culture, and are present in several geographical regions across our planet, as either fortune telling devices (in fact, this is one of the reasons expert think dices came to be), dispute solving methods or as **games of chance.**

## How does our game work?

In all of their years of existence, dices have been used for several games of chance, as for example in:

* Backgammon
* Yahtzee
* Dice Chess

The game we created utilizes a two player approach, and thanks to blockchain technology - *and more specifically, the unique groundbreaking technologies of the Internet Computer* - can be played alone, against the True Odds protocol as a party.\
\
Let it $$a$$ be our True Odds canister instance, and $$b$$ an arbitrary player who wants to try their luck.\
\
In our game both parties, $$a$$ and $$b$$ , will directly compete in a game of *secrets,* with a second party winning if it can randomly guess the secret of the first party, which will be made public beforehand (thus the second party knowing it's content), This secret of course, is which dice face has been chosen.

If $$a$$ revealed it's secret first, then $$b$$ could just match it (as there is not an easy way for $$a$$ to trust $$b$$), and thus win the game.&#x20;

Thus $$b$$ will reveal it's secret first, and then $$a$$ will be able to randomly  and verifiably 'throw a dice' , with  $$b$$ winning if and only if:

$$secret(a) = secret(b)$$​

The mechanism for randomness and how to verify it is present in the next page.

### Probability of winning

As True Odds uses a 6-faced dice, the chance of obtaining face $$p$$ are effectively $$p=\dfrac{1}{6}$$.

First, $$b$$ *arbitrarily* throws a dice (by selecting it's value on the True Odds dAPP), let's call the probability of him choosing said face  $$p\_1$$​

Then $$a$$ *randomly* throws a dice (by using the methods discussed in the next page), let's call the  probability of the resulting face $$p\_2$$​

As $$p\_1$$and $$p\_2$$ are not dependent in any way of each other, the probability of both parties ending with the same face $$i$$ is equal to $$i=p\_1p\_2$$, or what is the same  $$i=\dfrac{1}{6}\*\dfrac{1}{6}$$, which results in $$\dfrac{1}{36}$$. This indicates that $$i$$ will be the same selected face for both parties in exactly 1 over 36 cases.

But, the win condition of the game applies for *all​* faces of the dice, thus the second party will win in each and every case that both faces are the same, not just if the result is $$i$$. As there are 6 possible faces, the possibility of win is defined as:

$$x=6\*\dfrac{1}{36}$$ or what is the same, $$x=\dfrac{1}{6}$$.
