Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Delete elements from list..
Replies: 17   Last Post: Mar 8, 2011 5:37 AM

 Messages: [ Previous | Next ]
 Maarten van der Burgt Posts: 10 Registered: 5/7/10
Re: Delete elements from list..
Posted: Feb 27, 2011 4:35 AM

Ray,

You are correct: my rule would reduce {1, 9, 2, 3, 4, 5, 6, 7, 8} to
{1, 9}.
But as the y_i data are generally strictly increasing with only a few %
or less of the points where the y_i make a dip, this is not a problem.

Maarten

-----Original Message-----
From: Ray Koopman [mailto:koopman@sfu.ca]
Sent: Friday, 25 February, 2011 12:37
Subject: Re: Delete elements from list..

On Feb 24, 3:29 am, "Maarten van der Burgt" <Maarten.VanDerBu...@kla-
tencor.com> wrote:
> Hallo,
>
> Thanks everybody who replied to my questions.
>
> The real problem I have is just a bit more complex than my
> simplified example. My list is in fact a numerical 2D list like
> mylist1 ==== {{x_0, y_0}, {x_1,y_1},... {x_i, y_i}, ...{x_N, y_N}}.
> The xi are strictly increasing and the yi should be as well.
> Due to some measurement errors it can happen that this is not the
> case. I simply want to delete the {xi, yi} pairs where
> y_i <==== y_i-1. That way I end up with a list, mylist2,
> where also the y_i are strictly increasing.
> (that way I can make an Interpolation[Reverse/@mylist2]
> in order to have a function x_i(y_i)).
>
> but from a first look and the variety of the answers it seems
> that there is definitely something which should help.
>
>
> Maarten

Your rule would you reduce {1, 9, 2, 3, 4, 5, 6, 7, 8} to {1, 9}
which I don't think you would want to do.

Wouldn't it make more sense to delete only the 9?

(If we work from right to left instead of left to right,
deleting the current y if it's >== min[all previous kept y_i],
we do delete only the 9.)

Shouldn't the question be more like "What is the smallest set of
points that must be deleted to make y monotone increasing in x?"

Or, considering that all the y_i may contain error, you could find
the vector z that is closest to y (in some sense that depends on the
assumed nature of the errors) and is also monotone increasing in x,
and then do inverse interpolation.

Date Subject Author
2/21/11 Maarten van der Burgt
2/22/11 Bill Rowe
2/22/11 Bob Hanlon
2/22/11 Ray Koopman
3/7/11 Borut Levart
3/8/11 Peter Pein
2/22/11 DrMajorBob
2/22/11 James Stein
2/22/11 lshifr@gmail.com
2/22/11 Daniel Lichtblau
2/23/11 Achilleas Lazarides
2/24/11 Maarten van der Burgt
2/25/11 Ray Koopman
2/26/11 DrMajorBob
2/26/11 Ray Koopman
2/27/11 Maarten van der Burgt
2/27/11 Ray Koopman
3/8/11 DrMajorBob