Take the 2-minute tour ×
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It's 100% free, no registration required.

If I have a set of numbers, and I say I will filter the primes, that means to me that I will remove the primes, and return the remainder.

If I have a set of numbers, and I say I will sieve the primes, that means to me that I will keep the primes, and discard the remainder.

Is this correct usage of filter and sieve? Are they opposites?

Any alternative verbs that would express the notion of going through a set and choosing only those that meet a particular criteria?

share|improve this question
    
I don't think I've ever used "sieve" as a verb. "Filter" is what I would use for ending up with a list of primes; "filter out" might result in a list of numbers that aren't primes, but it might give the same results as "filter". Bottom line is, English ain't math, more's the pity. –  Marthaª Sep 4 at 18:57
2  
The definition of filter shows no preference for what is kept and what is discarded. The definition of sieve refers to a physical device that does filtering, and it also shows no preference to the question of what is kept and what is discarded. Filters and sieves separate things. Sieves separate physical things by dimension, notwithstanding Eratosthenes' metaphorical usage. –  Canis Lupus Sep 4 at 19:01
    
'Sieve' is a commonly used verb in cookery, but here the purpose of sieving is usually to homogenise, not separate. –  Edwin Ashworth Sep 4 at 19:07
    
@Marthaª Sieve is sometimes also a verb: oed.com/view/Entry/179421?rskey=y584Sj&result=2#eid –  guest Sep 4 at 19:07
    
@guest: oh, I'm fully aware that it can be used as a verb, but I, personally, have never used it so. There's a bit of chicken-and-egg, but it sounds awkward to me as a verb. –  Marthaª Sep 4 at 21:01

3 Answers 3

To keep only those elements which match a predicate, you'd normally say "select" ("Give me the positive integers, and I will select the primes").

Both "filter" and "sieve", as verbs, refer to the act (of separating wheat from chaff), not the result. When these words are used to describe or characterize results, they both can and have been applied to the parts kept (the wheat), and the parts discarded (the chaff).

If you specifically say "filter out", you are describing the elements you removed (discarded); if you say "filter for", you are describing the elements you retained (kept).

Note that I personally have not encountered "sieve" as a verb, only as a noun, and I would not say "sieve the primes". If I wanted to use "sieve" verbally, I would say "sift", as in "sift the integers for primes" (AmE, American Northeast).

share|improve this answer
    
So, sieve means the same thing as filter? –  guest Sep 4 at 18:59
3  
I've personally only seen sieve as a noun; to sift is the verb. A filter can be a noun or a verb. –  Dan Bron Sep 4 at 19:00
    
This conflicts with definition b here - "To take out by sifting" (ex. "They will find no lack of reasons why they and their representatives should not be sieved out of parliament.") –  guest Sep 4 at 19:01
    
That's why I said "personally". But that quote, using "parliament", may indicate it's a BrE usage, whereas I'm an AmE speaker. –  Dan Bron Sep 4 at 19:01
    
@guest: for me, that definition is not of the verb sieve, but of the phrasal verb sieve out; certainly both examples given use out after the verb. –  Peter Shor Sep 4 at 21:26

I agree with previous answers and comments that suggest the verbs filter and sieve refer to the act of separating, rather than to what is kept or discarded; but when an adverbial out or in follows, that no longer holds.

In my experience, the two verbs are distinguished by mode of application, with filtering applied to keeping or changing objects that satisfy or dissatisfy a predicate, as those objects are streamed through the predicate in a single pass, while sieving designates a process that in multiple passes over a data set winnows out objects that don't satisfy some pass-dependent predicate.

share|improve this answer

I'd say 'filter out' sounds better here, though 'filter' and 'sieve' overlap for part of their sense-ranges.

The snag is that the most famous of these processes (1,2,3 - Wikipedia) is invariably termed 'Eratosthenes's sieve' or 'the sieve of Eratosthenes' (Wikipedia). This is an example where noun and verb intercategorial polysemes don't match very satisfyingly in meaning.

The best example of this phenomenon I've come up with is 'telescope'n and 'telescope'v.

share|improve this answer
    
I've always understood "Eratosthenes' sieve" metaphorically to be an object; Eratosthenes constructed a sieve, and it is this sieve through which numbers are filtered. That is, the algorithm is a noun. Of course, the algorithm is also a process, and indeed prime sieves are described in that WP link as "processes" (in the case of WP's descripion, specifically subtractive processes: ...progressively removing...). –  Dan Bron Sep 4 at 19:27
    
I'm pointing out that the nounal usage ('Eratosthenes's sieve') is a crystallised term, but that I feel the preferred verb to use is 'filter (out)'. –  Edwin Ashworth Sep 4 at 19:33
2  
In my experience, it is never phrased as "Eratosthenes's sieve", but always "the sieve of Eratosthenes". (This is even true in the title of the linked wikipedia page.) –  Hellion Sep 4 at 21:25
    
If we're nit-picking, (1) in my experience, 40 years ago it was the other way round in BrE; (2) 'sieve' is often capitalised. Like 'Wikipedia'. I'm bringing out the point that the choice of 'sieve' rather than 'filter' in the noun phrase probably informs the choice of verb, though 'filter out' might be preferable. Or at least, I'm trying to. What is going on on this site? –  Edwin Ashworth Sep 4 at 21:36

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.