Tip:
Highlight text to annotate it
X
In this GeoGebra tip we want to create a sequence of points that divides a line segment into
a variable number of equally sized subsegments. That is, we want the following.
We have the line segment a=AB and we have a number n which is on a slider so it is variable
and we want to create this list here of black points here that divide the line segment into
equally sized pieces. So right now there are 5 pieces (4 black points) or 1 piece (no black
points) or 10 pieces (9 black points). So how do we do this
Let us create a line segment with our line segment tool. Click off the axes so our points
are free. One here and another here and make them free points. Let us hide the name of
the line segment. And we need a slider with a variable number of points. The minimum number
we can have is 1 so we will make our slider n go from 1 to 10 and pieces are whole numbers
so our increment is 1. So n is from 1 to 10 with increment 1. Apply.
Now let us move it over so we have something going on. Say n=5.
Now how do we make our sequence A sequence is a list of objects of the same type - here
we want points - that are generated by a formula with a “counter”. What size are our pieces.
Our pieces are (B-A) divided by n. And we want them to start being written at the point
A. So let us come down here to the input bar. Start typing the command sequence s e q and
we see the command we want, hit enter to go between the brackets and now we start at A
(we are writing our formula) plus B minus A divided by n. That will give us our first
point here. We need more points. So what we do is we multiply the size by the counter
using the letter k. We used to use the letter i, but now it is reserved for the complex
number, we use the letter k. That is our whole formula. Type comma. Now we tell GeoGebra
that our counter is called k. So the next variable after the comma is k, that is the
letter we are using for our counter. Another comma and now we tell it that we want to start
with k=1. Then another comma and we want to end with k=n-1 where n is the name of our
slider. Let us see if this gives us what we want.
So we have formula including counter, name of counter, counter beginning value, counter
end value. Let us hit enter. And we see the list here
of points and as we change slide n, whoops we see the list is empty because we haven’t
divided the interval. Now we could have gone from k=0 to k=n if we wanted these points
to be doubled. We only wanted the “inside” points in this particular example. We could
have gone from 0 to n and had included the endpoints in our list.
OK. So you see how to make the sequence. Now let us make another one just like it up here.
Make it from C to D. Notice we have “bad” values. It doesn’t matter. Hide the name
of the segment and let us do the same thing again. Start typing seq. There is our command.
Hit enter. Now our first point is C plus D minus C divided by n (we are dividing it into
the same number of points). We are going to use our same letter counter. Counters are
local – they can be reused. Again, comma. The name of our counter is k and we want it
to go from 1 to n-1. Now we are done. And now we have another sequence of points on
the other segment. Now let us say we wanted to join these points
with line segments. Now we are going to make segments using elements from this list and
elements from that list. So let us build our sequence. We still need to have a variable
number of segments. So again start typing sequence, hit enter. Here our objects are
segments here. I don’t think we can hit enter here. We have to go between the brackets.
Very carefully go. In GeoGebra 4 the brackets will be colored which is very helpful. Segment
and now we want to take an element from the first list so type in Element. Go between
those brackets, list1 and we want the k-th element. Now we get out of the Element bracket
and that is the first point – this one right here. Comma. Now we want to go to that element
(we want to draw a line segment). Start typing Element again. Go between the brackets, list
2 comma k. So now that is our segment formula. Segment going from the k-th element of this
list to the k-th element of that list. Now get out of “element” and out of “segment”.
Now we are to our counter, comma. What is our counter name So k comma and then again
1 comma n-1. There we go. And the way we set this up, we
can move all of our endpoints, we can stretch it or make it nice and even. Right. And we
have seen how to use sequences.