Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Lets say, I have a set $S= \{2,3,5,6,7\}$. I am having a logic query, if atleast $2$ elements greater $5$ is found in this set, then It should return true. $\exists x: (x>5)$. This formula works even if $S= \{2,3,5,6 \}$ but I want a formula works only if $2$ or more elements greater than $5$ is found.

Please help me.

share|improve this question

2 Answers 2

Try $$\exists x.\ x > 5 \land \exists y.\ y > x,$$ please note that the left quantifier extends its scope to the end of formula, i.e.

$$\exists x.\ \bigg((x > 5) \land \Big(\exists y.\ (y > x)\Big)\bigg).$$

Try to construct analogous expression for 3 elements $\ddot\smile$

share|improve this answer
    
It will by more convenient and readable if $\exists y$ is moved outside to same level as $\exists x$ –  Trismegistos Aug 22 '13 at 8:30
    
@Trismegistos I wrote it that way for the benefit of Matt (however, he removed his formula). –  dtldarek Aug 22 '13 at 8:41
    
@dtldarek Sorry, I didn't want to leave wrong things lying around. I appreciate it though! –  Matt Pressland Aug 22 '13 at 9:10

You can specify that a pair of objects should exist, e.g. $\exists\:(x,y) :(x>5\wedge y>5 \wedge x\ne y$).

share|improve this answer
    
Thanks for you help. I prefer the first one. My logic language doesnt support conjunction. –  Priya Yechuri Aug 21 '13 at 13:42
    
In what language is the first well-formed? -- unless the comma is just a notational variant for $\land$? –  Peter Smith Aug 21 '13 at 13:47
    
Also, in the second formula, the right appearance of $x$ is free (the scope of quantifier of left $x$ ends with the parenthesis). And you miss one closing parenthesis too. –  dtldarek Aug 21 '13 at 13:49
    
Hmm - the problem here is that I'm not a logician (although I can at least answer that the comma is indeed a substitute for $\wedge$). This is my own fault for not reading the tags; I'd read this as more of a programming question, so my answer should be read as a sort of pseudocode. If the second statement is completely wrong, I can just delete it (rather than worrying about how to fix the parentheses). If the first statement is also wrong then the entire answer should probably go. –  Matt Pressland Aug 21 '13 at 13:52
    
Well, I would say this is a good opportunity for you to learn ;-) Could you imagine, why a compiler would complain about the right $x$ begin undefined? –  dtldarek Aug 21 '13 at 14:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.