How can I express this statement with mathematical symbols?

79 Views Asked by At

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.

2

There are 2 best solutions below

1
On BEST ANSWER

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} \ $$

0
On

I saw the comments on the origional question, and thought I would elaborate on one of the answers

$T$ is a boolean, and is either true or false. If $T$ is true, then $B = h\cdot 1.5$. This give us

$$T \rightarrow B=h\cdot 1.5$$

Or in other words, $T$ being true implies $B = h\cdot 1.5$. If $T$ is false, then $\lnot T$ is true, and $B = h\cdot 5$. This gives us

$$\lnot T \rightarrow B=h\cdot 5$$

Or in other words, $T$ being false implies $\lnot T$ is true, which imples that $B = h\cdot 5$.