I'm trying to express the following statement using mathematical symbols:
The base time in seconds is the block's hardness multiplied by 1.5 if the player can harvest the block with the current tool, or 5 if the player cannot.
If I represent the base time as $B$, the hardness as $h$ and the optimal tool as $t^*$ then I can start the statement as:
$$B = h \cdot ()$$
However, that's where I get stuck. From a code standpoint, it's easy to express as:
if (t*)
b = h * 1.5
else
b = h * 5
I thought using the symbol for implication (I think) would work, but after further research, it reads as true or false, not conditional assignment. For example:
$$x = 2 \implies x^2 = 4$$
This statement evaluates to true because it is read as (I think):
$x$ is equal to $2$ if $x^2$ is equal to $4$.
Meanwhile $x^2 = 4 \implies x = 2$ evaluates to false because $x$ could be $-2$.
How can I translate this statement using mathematical symbols only?
Note: This is for recreational practice.
Another way to do this would be to use the notation for piecewise functions; if we consider $B$ to be a function of the current tool $t$, and the optimal tool to be $t^*$, then we can write: $$ B(t)= \begin{cases} 1.5h, & t=t^* \\ 5h, & t\neq t^* \\ \end{cases} \ $$