MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: List manipulation question

  • To: mathgroup at
  • Subject: [mg67205] Re: List manipulation question
  • From: Bill Rowe <readnewsciv at>
  • Date: Sun, 11 Jun 2006 23:08:32 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

On 6/11/06 at 2:17 AM, lectorz at (LectorZ) wrote:

>I need to calculate distances between the elements of the following

>list={3700, 3800, 3900, 3950, 4000, 4050, 4100, 4150, 4200, 4250,
>4300, 4350, 4400, 4450, 4500, 4550, 4600, 4650}

>with the following logic:

>a) If it is the first element, then take the simple difference to
>the next (i.e. 3800 - 3700)

>b) If it is the last element, then take the simple difference to the
>second last (i.e. 4650 -4600) 

>c) the difference for all elements in between shoud be calculated as
>(next - last)/2 (i.e. (3900 - 3700)/2)

>This list should come out as a result:


Your c) doesn't quite make sense to me. 3700 appears once as the first element. I don't see how to equate 3700 with "last". 

In any case, I can get the same result as you show with


To reply via email subtract one hundred and four

  • Prev by Date: Re: a list as an option
  • Next by Date: Re: List manipulation question
  • Previous by thread: Re: List manipulation question
  • Next by thread: Re: List manipulation question