How to plot odd and even function together?

Justinj001 shared this question 1 year ago
Answered

While I tried plotting odd and even function together an error message popped up saying Illegal argument if (1,0).

Could anyone tell why this message came.

Comments (21)

photo
1

please post what you exactly wanted to do, because your message seems a little cryptic.

chris

photo
1

I really meant to say that I couldn't plot two functions f(x)=2x and f(x)=2x+1 together. While I click the square next to the place where the function is defined, it displays an error message : Illegal argument if (1,0). Is there anyway to see the graph of two functions plotted against each other?

photo
1

I still don't get the problem.

I adde d a file in which I typed in the input bar 2x, and after that 2x+1, creatig the graphs of the two functions.

And then??

chris

photo
1

.....comes the problem of plotting the two function against each other. I tried the file, but it still displays the same error message that displayed before.

photo
photo
1

Try calling the second one g(x) not f(x)

photo
1

I tried that too but still it shows the error message Illegal argument if (1,0).

photo
1

an attached ggb file and/or a screenshot can be help


are you sure that you are not typing f(x)=x,(1,0)

photo
1

Yes. I have attached the file. I guess you might have to type f(x),g(x) in the place where it says h(x) is undefined. Now ,when you click on the square next to the input bar you can see that, it displays(I hope) Illegal argument if (1,0).

photo
1

in your file it's possible to see this code:


f(x) = 2x
g(x) = 2x + 1

but it's not possible to see what you define for the object "h" in the input-box (before you become the error-message).

.

please send your complete string, exact and complete as you type in the input box, for the object "h", before you give enter and you become the error message (for example: "h(x)=g(x) + 1,0"). And describe what you want achieved with this input (for example: "a parallel line to g with distance +1 on yAxis")

Note:

after close and reopen the list of past entered commands is empty

photo
1

To be honest I typed f(x),g(x) in the 3rd input bar and saved the file. However, after I export the file to .ggb and reopen the saved file, it somehow shows h is undefined. Could you tell what I need to do to enclose the 'function definition' in the saved file?


Here's the Complete String : f(x),g(x) (this is how I typed it in the input box)


photo
1

Now I can reproduce the error-message. But I can not reproduce the object h(?). This in GGB5.0 and GGB6.0 classic desktop, win10. That mean: in my environment the behavior of GGB is correct. That mean I can not produce a reproducible documentation for a possible bug fix. And without this documentation it's not a bug.

You can do nothing to save a wrong command-line as an object. GGB must refuse this. Otherwise it would be a (documented) bug.

.


But anyway, the command f(x),g(x) is sure wrong. For me (and for GGB) he make no sense.

To give (maybe) a solution for a correct syntax I need your answer for:

what you want achieved with this input? (for example: "show all point when f(x) and g(x) intersect" or "the answer from GGB to the question: is g(x) parallel to f(x)" or "the addition of the 2 functions with the result of a new parallel line to f(x) and g(x)" or "I want see all (wrong or correct) inputs of an user (something like a log)")

photo
1

I read again your first post:

How to plot (define?) odd and even function together?

(and maybe this is the answer to my question in my last post)

Maybe you mean "together" as


  • 1 object (as list)->> {f(x), g(x)} <<- very similar but not equal what you has type in
  • 1 line and 1 object in the input-line (as list) ->> {2x, 2x+1}
  • some odd as 1 object (as list)->> {2x+1, 2x+3, 2x+5 .....}
  • some even as 1 object (as list)->> {2x+0, 2x+2, 2x+4 .....}

Note: in a list all elements has the same properties (for example color) . So it's can make sense to define separate lists for all odd and all even.


or maybe you are looking for something as in the attachment (with 2 variants).

photo
1

I opened the attached file but I couldn't understand the graph in the file. I'm trying to plot a relation R : {(x,y): x is an odd integer, and y is an even integer.} Can you help me in plotting this relation.

photo
1

quote: x is an odd integer, and y is an even integer

this, I think, I have understand, even(x) and odd(x) in the attachment

.

but rel(x,y) (in the attachment) make no sens for me

Maybe you can send a photo from a (manually created) graphic

photo
1

en un alarde de imaginacion pienso que lo que quiere es algo como Sequence(Sequence((2k, 2j + 1), k, 0, 20), j, 0, 20)

photo
1

excuse Sequence(Sequence((2k+1, 2j), k, 0, 20), j, 0, 20) for (odd,even)

photo
1

Sorry for the late reply. Could you tell how to insert this sequence into a function, so I could restrict the domain to odd numbers.

photo
1

this is not a function. this is a set of points with first coord odd and second coord even

photo
1

Please tell me why I can't graph this function Sequence((2k+1, 2j), k, 0, 20), while it's possible to graph the function Sequence(Sequence((2k+1, 2j), k, 0, 20), j, 0, 20).

photo
1

because Sequence((2k+1, 2j), k, 0, 20) has two counters i,j . then it needs values for i and j

perhaps you want Sequence((2k+1, 2k), k, 0, 20) or

Sequence((2k+1, 2k+2), k, 0, 20)

photo
1

Why it's possible to have two variables(j,k) in a Sequence function, when only one variable is shown in the syntax of Sequence function?

© 2019 International GeoGebra Institute