# Math Help - Developing predicates...

1. ## Developing predicates...

Hey everyone, I am trying to develop a predicate for the following sentence...

In the array segment g[m...n) there are at least three occurrences of values greater than x.

So far, I have:

Code:
A k|m<=k<n:
Where "A" should be the "For all" quantifier. Now, I guess my question is, how do I express "at least three occurrences of values"?

I need to somehow show that there are at least three values contained in the array which are larger than x (whatever it may be). So, if I can show three values in the array, then we know there are exactly three values which can be greater than x. But there could be five values, or twelve values. So would the three translate to >=3 to express the "at least"?

Thanks!

2. Hi

I give you an answer for a similar but more general problem so you can adapt it to yours:
Let $A$ be a subset of $\mathbb{Z},\ x$ an integer and $n$ a positive integer. How could we write a formula meaning: "there are at least $n$ integers in $A$ which are greater than $x$"?

First we can think it in a more formal way: "there exist $n$ integers in $A,\ x_1,...,x_n$ which are all different and such that $x_i>x,\ i=1,...,n$"

I guess that shows us a way to write our formula:
$
\exists x_1...\exists x_n(\bigwedge\limits_{ix))$