1

I am working on a homework assignment where I am forced to take a scenario and convert it into a logical statement.

The scenario I am working on involves 10 variables, where only 5 can be true at a time.

I have learned about both types of quantifiers, universal and existential, but how can I specify a particular number in a logical statement.

I am trying to write the following:

There exists 10 variables in a set, such that only 5 can be true at a given time.

How can I specify 5 in logic terms?

  • 1
    The brute force way would be simply OR together all 252 (10 choose 5) ways to have 5 true variables and 5 false variables, where each way is expressed by ANDing and NOTing the variables together in the right way. You might have more luck with making this an integer programming problem, where your trues and falses are 1s and 0s, and you just need V1+V2+...+V10 =5. – Nuclear Hoagie Apr 16 '20 at 18:40
  • 1
    Can the set contain more than 10 variables ... but it's just that there is some subset of 10 variables only 5 of which are true? As such, do you need to have that set symbolized as an object in your formalization? And have 'element of' be formalized as well? By 'only 5' do you mean 'exactly 5' or 'at most 5'? Are the variables to be treated as objects? Or do you have to formalize them as propositional logic variables? For some tips on expressing numerical claims, see here: https://math.stackexchange.com/questions/2037209/how-to-convert-numerical-claims-to-first-order-logic/2037698#2037698 – Bram28 Apr 16 '20 at 19:02
  • After you ask a question here, if you get an acceptable answer, you should "accept" the answer by clicking the check mark $\checkmark$ next to it. This scores points for you and for the person who answered your question. You can find out more about accepting answers here: How do I accept an answer?, Why should we accept answers?, What should I do if someone answers my question?. – user400188 Apr 19 '20 at 03:13

1 Answers1

1

As Nuclear Wang pointed out, the brute force way would simply be to OR together all 10 choose 5 ways to have 5 true variables and 5 false variables, where each way is expressed by ANDing and NOTing the correct variables together.

If you wish to use predicate logic with quantifiers however, you can make use of the standard expressions for exactly 10 of and exactly 5 of. I have written this below:

Exactly 10 members of in a set X:

\begin{align}\tag{1} \exists x_1,x_2,\dots,x_9,x_{10}\big(&(x_1\neq x_2\land\dots\land x_9\neq x_{10})\\ \land&(x_1\in X\land x_2\in X\land\dots\land x_9\in X\land x_{10}\in X)\\ \land&\forall y(y\in X\implies y=x_1\lor y=x_2\lor\dots\lor y=x_9\lor y=x_{10})\big) \end{align}

Exactly 5 members of in a set Z:

\begin{align}\tag{2} \exists z_1,z_2,\dots,z_4,z_5\big(&(z_1\neq z_2\land\dots\land z_4\neq z_5)\\ \land&(z_1\in Z\land z_2\in Z\land\dots\land z_4\in Z\land z_5\in Z)\\ \land&\forall y(y\in Z\implies y=z_1\lor y=z_2\lor\dots\lor y=z_4\lor y=z_5)\big) \end{align}

Only the members of $Z$ are true:

\begin{align}\tag{3} \forall p\big(T(p)\implies p\in Z\lor p\notin X\big) \end{align}

In $(3)$, $T(p)$ asserts that $p$ satisfies some truth condition. It could be that $p$ has a truth value of $1$, or that $p$ satisfies another condition, like being greater than 2.

You then need only assert that $Z\subset X$, and logical AND (1), (2), & (3) together. The set $Z$ will then consist of the $5$ true variables from the set $X$.

If you language does not support the $\in$ or $\subset$ operators, you can just treat them as a two place predicates, which are true when the operators returns true.

user400188
  • 1,966