Outliers in a List in Sequence command

bennyjacob shared this question 5 months ago
Answered

Why there are some outliers towards the beginning and end in the graph of the following command?

l2=Sequence(Intersect(f,xAxis,(n,0)),n,-10 π,10 π)

How to give Names/Captions to each point in the above set of points in sequence?

How to make permutations with the above set of points, especially when I wish to make n permutations with inequalities as a_1<=a_2<=a_3<=...a_n?

Best Answer
photo

maybe the attached compact example is helpful

Note: {Roots()} as robust alternative to intersect

Note: Script in A and B

  • snap or fix to points
  • A must be <= B (flexibility with pathparameter)

Note: pixX = Length of 1 pixel depending zoom (needed in snap)

Note: the effect of the 3 boolean

Note: The definition variant to split the function into positive and negative

Comments (45)

photo
2
  1. the points (n,0) are initial points for calculating intersections, the intersections can be near or far of this points. if you want to limit the domain of sequence you can use a keepif() command
  2. no possible one name for each object in a sequence

photo
1

Dear Mathmagic,

Thank you so much for your prompt reply and solutions.

I somehow managed to remove the outliers with a number of commands. I would like to know how to use Zip commands instead of Sequence command in this. Can I use shorter steps than I used here.

I have made a geogebra applet to find the area above and below xAxis between x=a and x=b. I made an applet for abs(x)-3. I want to move the graph anywhere and my intention is to develop this applet to find the said area for any function.

photo
2

One proposal:


Define g(x)=0


Then:


L={Intersect(f,g,-10 π, 10 π)}

photo
2

Yo lo haría así

Files: foro.ggb
photo
1

Dear mathmagic,

Thank you so much for your support.

Kindly help me to simplify the following applet. I am working on this for two three weeks. Still there are some errors. I wish to use this for any function, even if it is above xAxis. The intended intersections 'c' and 'd' are not getting in the proper way as expected for other functions of different family.

photo
1

Wherever I move 'a' and 'b', I want to get the area above and below xAxis between x=a and x=b.

Kindly make the Applet much simpler so that I can open it in Ubuntu unless there are no limitations there. Otherwise, Applet in geogebra web view is enough.

photo
2

sorry. I can not to explain in english

no creo que sea posible hallar los puntos de corte de cualquier función con el eje x. tú ya sabes cómo calcularlos si están suficientemente distanciados y creo que la mejor manera de obtener resultados sería usar la parte positiva y la negativa de la funcion por separado. Intenta integral((f+abs(f))/2,a,b) para la zona positiva y integral((f-abs(f))/2,a,b) para la zona negativa.

lo dificil es obtener el listado de soluciones de f=0 y no creo que sea posible para todos lo casos

photo
1

It’s so kind of you. Thank you.

photo
photo
2

maybe the attached compact example is helpful

Note: {Roots()} as robust alternative to intersect

Note: Script in A and B

  • snap or fix to points
  • A must be <= B (flexibility with pathparameter)

Note: pixX = Length of 1 pixel depending zoom (needed in snap)

Note: the effect of the 3 boolean

Note: The definition variant to split the function into positive and negative

photo
1

Sir Rami,

Wonderful syntaxes and Algorithm. I am trying hard to get hold of the details in it. Congrats and thanks.

Kindly help me to simplify the following applet. Two samples are given viz. sin(x) and abs(x-1)-3.

I am working on this for two three weeks. Still there are some errors. I wish to use this for any function, even if it is above xAxis. The intended intersections 'alpha' (or 'c') and 'beta' (or 'd') are not getting in the proper way as expected for other functions of different family. Wherever I move 'a' and 'b', I want to get the area above and below xAxis between some x=a and x=b, not necessarily quadrantal angles. Kindly make the Applet flexible with your GeoGebra comments and algorithm.

photo
1

With the exception of the sliders you will find everything (and more) you need in my example (and in the descriptions and samples of Mathmagic). You "only" have to understand and implement it.

If you have problems understanding: 1. study the commands in the manual and 2. ask (concretely and specifically)

photo
1

When the function f(x) is changing, the integral F(x) becomes undefined. That's one concern.

photo
1

for what (new) value in object f object F become undefined.

photo
1

When f(x) = sin(x) changes to f(x) = sin(x)+0.2, the integral F(x)=integral(f,x) or integral(f) should have to change to cos(x)+0.2x. However, when I change f(x), F(x) becomes ?/undefined and when I go to Algebra part and refresh F(x), it becomes fine in Graphics2. Is this a bug in GeoGebra. Without refreshing in Algebra view, will the integral F(x) not be changed in its own. That's why I have made Inputbox4 for F(x) in Graphics view to manually give the comment there. But that too shows error while trying to input in Inputbox4 of Graphics2.

I just want to find the local integral between a and b in the neighbourhood of alpha<=x<=beta. That is why I have made inequalities that are 5!/2! permutations of a, b, alpha, beta and (alpha+beta)/2. Are there Geogebra comments to generalize this with the movements of a, b, alpha and beta?

photo
1

For any change in f(x), F(x) becomes undefined here in Geogebra web.

photo
1

In my environment (windows 10, chrome, ggb5.0.627, classic) I cannot reproduce the problem.

Which ggb version do you have, which app (e.g. classic or geometry or ....) and in which environment (e.g. windows 10, chrome)?

photo
1

I am using the same windows 10 ggb classic web version 6.0.625.0-w(19 Jan 2021) in chrome.

photo
1

I have made inequalities that are 5!/2! permutations of a, b, alpha, beta and (alpha+beta)/2 and followed my logical arguments and permutations with a, b alpha and beta. Are there Geogebra comments to generalize this with the movements of a, b, alpha and beta? Waiting for your Algorithm.

photo
1

Back to your answer to my question:

OK: update to 6.0.627 and test (the case sin(x)+0.2) again.

And please not more then one question in the same time.

photo
1

LOL... Thanks for your support. How can I update web version? Should I download the latest version

photo
2

Download ggb version 6 is here

download ggb version 5 is here

BUT!!! for windows no version 6.0.625 or 6.0.627 exists (only in ggb version 5)

That's why I think you are using ggb version 5 (and not ggb version 6)

If my guess is correct: download and install (from here msi-Version)

photo
2

Strange!!!

I test with this link

here 6.0.625 exist and is the last version and here I can reproduce the undefined F.

I think this is a Bug.

go to version ggb 5 (local, no web, some things change) or wait until the bug is repaired.

photo
1

Thank you sir. I am downloading, and will find a solution for my first problem.

photo
1

Sir Rami,

You are correct. The GGB version 6.0.620.0-offline (01 December 2020) works without error. Getting F(x) in the right way. I thing now my Applet works perfect. What do you think!!

Will you give a solution for my second problem, a fine tuned ggb algorithm for the permutation part I did in my ggb Applet!!

photo
1

Sorry sir. I was in some work so that I didn’t notice the movement of A and B in your applet. Your applet is perfect. Now I got opportunity to think differently with the freedom of your syntaxes used in ggb. Thanks a lot.

photo
1

Will you explain Li2?

photo
1

range is 10pi

Extremum(f, -range, range) --> create a lot of points but there are needed as list, so you must write in {..}

{Extremum(f, -range, range)} --> but the y value of all this points must be 0

Zip((x(P), 0), P, {Extremum(f, -range, range)}) --> Each element of the above list is given the local name "P" (the name P is valid only within the Zip() command). With each P the first parameter of Zip is executed and create the point (x(P),0). The sum of all executed expressions of the first parameter forms the new list.

Join({<list1>,....<listn>}) --> makes a single list out of many lists (connect the lists to one list)

Join({<list1>, If(!<condition>,{},<list2>)}) --> list2 is appended to list1 if the condition is true. If the condition is not true, an empty list (nothing) is appended to list1.

Li2 = Join({Li1, If(¬extremum, {}, Zip((x(P), 0), P, {Extremum(f, -range, range)}) )}) --> all extrema of the function are appended to Li1 if the condition extremum is true. The extrema are marked as points on the x-axis.

photo
1

Como siempre RAMI hace el mejor applet para mostrar lo que ocurre en las situaciones a estudiar, pero...... sigo apuntando que creo que no hay proceso que cubra todas las necesidades de cualquier función salvo analizar cada pixel para averiguar que es lo que ve el usuario, aunque también puede ser un efecto del zoom

/0AlRAfZFOGoAAAAAElFTkSuQmCC

photo
1

I see on your picture that the intersection point of the function with the x-axis is not present in the area ca x=28. In addition, B is not snapped exactly to the intersection point at approx x=22.

The missing point should have been created with Roots().


I can not reproduce this error with the file 03b (but also 03) (ggb5.0.627 windows10).Maybe we do not use the same file or a different environment.

Regardless, however, I agree in principle with your statement above.

85bcac038a187afb50f370b3bd5a7ea7

photo
1

Sir Rami, I am studying your algorithm. I think I have to think and know a lot about the functions of each and every command you have used in here.

Is Li2 gives the empty list for points out of Extremum points +-10pi?

Why A and B do not move out of 10pi in this applet to see that empty list?

photo
1

I want to know about the pixel thing and zoom effect both of your were discussing? What does pixX do? What are corners 1, 2 and 5. What is the function of the ratio pixX?

photo
1

quote: "Is Li2 gives the empty list for points out of Extremum points +-10pi?"

I am not sure what you mean exactly:

Li2 never has extremum-points outside range (because {Extremum(f, -range, range)}) has a range)

Li2 always has the points of Li1

Li2 has no extrema if !extremum or no extrema are found within the range

Li2 can be empty if no points in Li1 and if the above condition is true

---------------------

quote: "Why A and B do not move out of 10pi in this applet to see that empty list?"

This is completely independent of the points in Li2. See the definition of A and B.

It is a point that lies on a segment (defined with range) (and it can never leave this segment)

----------------------

quote: "I want to know about the pixel thing"

Motivation: To snap a Point (in onUpdate-script of A and B) a certain distance must be undershot. The problem is that when the image is zoomed the distance on the screen also increases. However, the distance for triggering the snap should always be the same on the screen. Therefore, the distance should not be a ggb unit but a unit in (ggb) screen pixels.

Number of pixels in a windows:

this number can be queried with the command Corner(5) (see also manual). The result is a point with x and y number of ggb-pixels. This number does not change as long as the dimension of the window does not change. The number does also not change even if the image is zoomed.

Corner(n) (n=1 to 4) (see manual)

give the ggb-Coordinates of the 4 Corners of the windows

Distance(Corner(1),Corner(2)) give the horizontal length in ggb-Units of the windows.

Question:

how long (in ggb-Units) is 1 ggb-pixel horizontal (please try to answer with the commands above: pixX=?????, and look not in the program because there is something else I want to explain afterwards)

photo
1

Sir Rami,

How do you made the check boxes rootFix, extremum and recalc?

What comment/function is appended to each of them?

Is there any keyboard shortcut for the Boolean "not" other than !, to use in !extremum in Li2? Is this the same given in checkbox 'extremum'?

photo
1

quote: "How do you made the check boxes rootFix, extremum and recalc?"

fec11798697fa649d2a4e37f7da08782

quote: "What comment/function is appended to each of them? (bolean)"

This is the wrong question. A good question would be: where are these Boolean used.

  • extremum is used in Li2
  • rootfix is used in the script onUpdate A and B
  • recalc is used in p and n

quote: "bolean 'not" "

you can use ! or ¬ (the moste keyboards has "!" so use this)

------------------------------

All three questions are actually unnecessary.

I think you should concentrate on each object (in the order of the algebra view) until you really understand it. For this it makes sense to make your own experiments/tests in a separate applet.

photo
1

I couldn’t understand the use of the Boolean rootFix in your program!! What is the relevance of the Boolean rootFix in your program? I find no change with or without rootFix. Where is the Boolean rootFix used?

Kindly see the attachment in which I have just copied your work.

photo
1

You have not considered the script in A and B.

(select A, Properties, Script, OnUpdate)

photo
1

What do you mean by Scripts in A and B? I am new to that concept. Kindly explain.

When I reproduced your applet, I am getting Integral(f,B,A) also. I think, you have restricted this property by scripting, haven’t you? Which page I have to refer to understand the scripting you have mentioned here.

https://wiki.geogebra.org/e...

https://wiki.geogebra.org/e...

photo
2

quote: Kindly explain...........

The best way to understand scripts is to study examples and do your own experiments. You can find examples here. I recommend the book by Chris Cambre

Scripts are an add on to the command of an Object. A script is executed when an event occurs. GGB knows 2 events: Click on a certain object and "the object is updated". In both cases the script is stored at the object in Properties/Script (please have a look at these properties in my program for A and B.). It's time to look at all properties anyway, it's important).

The scripts I created make sure that when you move A or B, the point on Li2 (magnetic) snaps or can only be moved on the points of Li2 (not in between). Just now I realize that the second line in the script is not necessary (but does not hurt). In other words: line 1 in the script is nice to have, line 2 is not necessary.

---------------------------

quote: "When I reproduced your applet, I am getting Integral(f,B,A) also. I think, you have restricted this property by scripting, haven’t you?"

no there ar no scripts.

But in my Programm i write: p = Integral(If(f(x) ≥ 0, f(x), 0), x(A), x(B), recalc) (and not Integral(f,B,A))

If recalc == false then ggb draw the Integral but not calculate the value. In this case the Performance is better.

This you can find in the desciption of Integral() (I hope you has found this command in the manual und you have read it)

================================================================

In the meantime, I think that the task you have set yourself is too large.

I think it is better if you first work through the basics in some tutorials. Then you can go back to this task.

photo
1

Where will I get tutorials? Can you suggest some sites or books? I need more examples to practice.

photo
1

Dear Rami,

Kindly check the attached ggb file in which the first list/sequence I1 of integrals, I am getting {(?, -5)} up to {(?, -10.21)} respectively when x(A) = -8.81 approx. and x(B) = -5 respectively up to x(A) = -8.81 approx. and x(B) = -3.65. Why is this so? I wanted to get the list of integrals between roots of f within x = x(A) and x = x(B).

How can I get a single element/integral in the list when the integral is between A and B when length(segment(A,B)) < distance between two adjacent roots of f?

photo
1

The same issue continue in all intervals, ‘A’ being fixed at a root and ‘B less than or equal to the adjacent root.

photo
photo
1

hey rami

el error se produce cuando cambias varias veces el valor +1. Por ejemplo poniendo +2,+3,+4,+1 etc

cuando la longitud de la lista de soluciones disminuye y luego aumenta parece que GG desprecia alguna de las soluciones y le cuesta trabajo aumentar el numero de ellas hasta completar todas las que hay en la nueva situacion

espero se me entienda

photo
1

OK, I see it.

thanks

photo
1

What does mathmagic mean by the occurrence of error when changing +1 multiple times? Do you mean when you make changes in function cos (x/2).4 +1?

photo
1

yes

photo
© 2021 International GeoGebra Institute