How do write "at least 2" in logic in short?

322 Views Asked by At

Let me find a simple example:

$Q$: Q is inside the box

$R$: R is inside the box

$S$: S is inside the box

$T$: T is inside the box

Now if I want to express this: "If character $Q$ is inside the box, then at least two of the other characters are inside the box."

How can I do this correctly and short? I think the "at least" I can force it with logic AND. I need to AND all possible combinations and put an OR in between them:

$$Q \rightarrow ((R \wedge S \wedge T) \vee (R \wedge S) \vee (R \wedge T) \vee (S \wedge T))$$

My question is, can I do this any shorter? Maybe there is a formula to do it when a task asks me something like that for "at least $n$"?

1

There are 1 best solutions below

0
On

You can also say

$$Q\implies \Bigl((R\wedge S \wedge T)\text{ xor } \lnot R \text{ xor } \lnot S \text{ xor } \lnot T\Bigr)$$