Intereting Posts

solution of ordinary differential equation $x''(t)+e^{t^2} x(t)=0, for t\in$
Is there any function continuous in $R$ and differentiable in rational numbers with zero derivative?
How do I get a sequence from a generating function?
Union of ascending chain of Topologies
Inverse function theorem question – multivariable calculus
How do I get $\cos{\theta} \lt \frac{\sin{\theta}}{\theta} \lt 1$?
Linear Homogeneous Recurrence Relations and Inhomogenous Recurrence Relations
Continuity of the inverse matrix function
Algebraic Geometry Text Recommendation
Showing Sobolev space $W^{1,2}$ is a Hilbert space
$(R^{\oplus A})^{\oplus B} \approx R^{\oplus (A\times B)}$?
Endomorphism rings and torsion subgroups.
Finding multivariable limits for the function $\frac{3x^2y}{x^2+y^2}$
Non-abelian group of order $p^3$ without semidirect products
Maps of primitive vectors and Conway's river, has anyone built this in SAGE?

I would like to know how to express mathematically $n$ largest values of a given set $A$.

For example: I have an unsorted set $A$ with $100$ values $\in \mathbb{N}$ and want to get a new set $B$ with the $5$ largest values.

Thank you in advance!

- What does the plus sign contained in a circle ($\oplus$) mean in this case?
- What does it mean when dx is put on the start in an integral?
- Different of mapsto and right arrow
- How do you pronounce (partial) derivatives?
- What does | mean?
- What is “multiplication by juxtaposition”?

- Is arrow notation for vectors “not mathematically mature”?
- Why do statisticians like “$n-1$” instead of “$n$”?
- Ambiguity of notation: $\sin(x)^2$
- What are the common abbreviation for minimum in equations?
- Generalization of a product measure
- Is a bra the adjoint of a ket?
- What does this double sided arrow mean?
- This multiple integral notation, has it got a name? $\int dx \int dy \, f(y,x)$
- How many total order relations on a set $A$?
- How to write down formally number of occurences?

I don’t think you can do this in any easy way, unless you basically write a sentence to define the set. However, you could do it inductively:

Define $A=A_0$. Write $$B_1:=\{b\in A_0: b\geq a\:\forall\: a\in A_0\}$$ and define $A_1:=A_0\setminus B_1$. Then inductively, write $$B_{i+1}:=\{b\in A_i: b\geq a\:\forall\: a\in A_i\}$$ and define $A_{i+1}:=A_i\setminus B_{i+1}$. Then $B_5$ is the set you are after.

**EDIT:** In the comments you said that $A$ can be a *multiset*, and so can have more than one element of a given value. This means that, in the above, $B_5$ could be the entire set $A$. (For example, take $A=\{3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, \ldots\}$). So, what you want to do is set $\overline{B}:=B_i$ where $|B_i|\geq 5$ but $|B_{i-1}|<5$, set $C:=B_i\setminus B_{i+1}$ (these are the elements which we want to remove some of) and set $\overline{C}$ to be a subset of $C$ with $|\overline{B}|-5$ elements. Then take $B:=\overline{B}\setminus\overline{C}$.

*There has to be a neater way though!*

It can be done using 5 iterations of removing the maximum element from set $A=A_0,A_1,\cdots,A4$ define $A_{k+1}=A_{k}-Max(A_k)$where a maximum exits, and let $B_k=A_{k}-A_{k+1} $ then the set $\cup_{k=0}^{4}B_k$ is the set of top 5 largest elements.

- Closed form for $\int_0^1\frac{x^{5/6}}{(1-x)^{1/6}\,(1+2\,x)^{4/3}}\log\left(\frac{1+2x}{x\,(1-x)}\right)\,dx$
- What is the interpretation of $a \equiv b$ mod $H$ in group theory?
- Matrix exponential of a skew symmetric matrix
- Finitely generated projective modules are isomorphic to their double dual.
- What is a natural number?
- The dual of subspace of a normed space is a quotient of dual: $X' / U^\perp \cong U'$
- The series $\sum\limits_{n=1}^\infty \frac n{\frac1{a_1}+\frac1{a_2}+\dotsb+\frac1{a_n}}$ is convergent
- Let $(x_n)\downarrow 0$ and $\sum x_n\to s$. Then $(n\cdot x_n)\to 0$
- a set of functions that are pointwise equicontinuous but not uniformly equicontinuous, supposing the domain of f is noncompact
- Definition of hyperbolic lenght.
- There is a square $Q$ consisting of $(0,0), (2,0), (0,2), (2,2)$
- Given an exponential generating function, is it possible to isolate only the even terms?
- Axiomatization of angle measuring in real vector spaces
- Combinatorial Identity $(n-r) \binom{n+r-1}{r} \binom{n}{r} = n \binom{n+r-1}{2r} \binom{2r}{r}$
- Relation between bernoulli number recursions