[seqfan] Re: need help with query

Richard Mathar mathar at strw.leidenuniv.nl
Thu May 14 17:29:17 CEST 2009

```nd> Date: Thu, 14 May 2009 18:09:51 +0530
nd> Subject: [seqfan] Request for seqid :A000217
nd> From: nishant doshi <doshinikki2004 at gmail.com>
nd>
nd> Respected sir,
nd>   I have found that for the following problem we have the same sequence. the
nd> problem is as follow.
nd>   Assume that n persons are going in a road. there is a wall in between
nd>  initially all are going in the direction of the wall on a road. here we
nd> have to count the number of collisions between wall and person,AND between
nd> two persons.
nd>  They have to follow the condition that when a person is collision with wall
nd> or other person than it has to change the direction. in the case if
nd> collision between two persons, they both will reverse their direction. so
nd> after fixed number of collision all the n persons are going in the direction
nd> reverse to the wall. so te goal is to find the such number of collisions for
nd> n persons.
nd>

I sense this is a homework problem (so don't put the Nishant on the
cc list). I'd think this is a number of points
(=people) heading in a simple linear coordinate system with negative velocity
v all starting at points x_1, x_2, x_3 at t=0 towards x=0. In a diagram
of all the paths of these points as a function of time, assuming constant
v for each person, well get a very simple grid (intersections = collisions),
and the crossings are of course 1,3,6,10 (triangular numbers).

^position
| \
|  \
|\  \
| \  \
|  \  \
|   \  \  /
|    \  \/    /
|\    \ /\   /  /
| \    \  \ /  /
|  \  / \  /  /
|   \/   \/ \/
wall|--------------------------------------------> time

Counting collisions from the right to the left they are 1+2+3+4+...+n..
Things get more complicated if velocities and starting distances
are more complicated and we'd have to go beyond the binary collision
approximation (BCA as it's called in ion beam physics).

```