This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Technology & Calculator Open Topic subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Math and Science => Technology & Calculator Open Topic
Author Message
bbolman


Newbie


Joined: 29 Nov 2007
Posts: 7

Posted: 03 Dec 2007 06:46:23 pm    Post subject:

I'm trying to figure out how one would graph a Piecewise Function or a Greatest Integer Function on a calculator (I've got an 84 SE).

For reference, an example of a Piecewise Function would be:
f(x) = 1/2x+3/2, if x < 1

-x+3, IF x > 1

(all of that is in a bracket)

And a Greatest Integer function would be:

f(x) = [[x]]

( f(1)= 1 and f(0.6)=1 )


Last edited by Guest on 03 Dec 2007 06:59:30 pm; edited 1 time in total
Back to top
JoostinOnline


Active Member


Joined: 22 Aug 2007
Posts: 559

Posted: 03 Dec 2007 07:01:16 pm    Post subject:

Do this:
Y1=(X<1)(.5X+1.5)+(X>1)(-X+3)
Back to top
bbolman


Newbie


Joined: 29 Nov 2007
Posts: 7

Posted: 03 Dec 2007 07:13:44 pm    Post subject:

Brilliant. thanks. I can't believe I didn't think of that...

Figured out the second. it's y1 = int(x)


Last edited by Guest on 03 Dec 2007 07:27:17 pm; edited 1 time in total
Back to top
JoostinOnline


Active Member


Joined: 22 Aug 2007
Posts: 559

Posted: 03 Dec 2007 07:18:12 pm    Post subject:

No problem, and welcome to UTI Smile
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 03 Dec 2007 07:25:41 pm    Post subject:

As for the greatest integer function, it's implemented with int(, but the examples you give seem to indicate you're thinking of the least integer function, which you can calculate with -int(-X).
Back to top
bbolman


Newbie


Joined: 29 Nov 2007
Posts: 7

Posted: 03 Dec 2007 08:12:38 pm    Post subject:

Thanks to both of you. I figured out the greatest integer bit right before your post.

DarkerLine, wouldn't my example be an example of the greatest integer function? We just learned this today and my teacher gave 0 explanation, so I could be wrong.


Last edited by Guest on 03 Dec 2007 08:15:54 pm; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 03 Dec 2007 09:25:21 pm    Post subject:

The greatest integer function is defined as the greatest integer (duh) which is less than or equal to x. So f(0.6) is 0.

However, the "least integer" function is defined as the least integer which is greater than or equal to x. Here, f(0.6) is 1.

Naturally, this is quite confusing because "greatest integer" returns a smaller result than "least integer." So most people refer to this as "ceiling" and "floor" - floor rounds down to an integer, and ceiling rounds up to an integer.

While the TI-89 has floor() and ceiling() commands, the TI-83+ series calculators have the int() command, so you use int(X) for floor(X) and -int(-X) for ceiling(X). Can you see why -int(-X) works?


Last edited by Guest on 03 Dec 2007 09:26:35 pm; edited 1 time in total
Back to top
Pseudoprogrammer


Member


Joined: 12 Dec 2006
Posts: 121

Posted: 03 Dec 2007 09:47:01 pm    Post subject:

Quote:

Code:
Y1=(X<1)(.5X+1.5)+(X>1)(-X+3)


Can be optimized, the -X+3 can be 3-X right?
Back to top
JoostinOnline


Active Member


Joined: 22 Aug 2007
Posts: 559

Posted: 03 Dec 2007 09:53:23 pm    Post subject:

Yes, but I didn't want to change the example that he gave around. Also, since this is only about a graph and not programming, I didn't think that saving a byte mattered.
Back to top
thornahawk
μολών λαβέ


Active Member


Joined: 27 Mar 2005
Posts: 569

Posted: 03 Dec 2007 10:19:17 pm    Post subject:

To add: the nearest integer function nint(x) can be done on the TI 83/84/+ as either round(X,0) or int(.5+X).

The Iverson bracket notation, methinks, is more useful, both on the calculator and mathematically, than the "bracketed" piecewise notation.

I mean, it's easier to see that 1−(X>0) and (X≤0) refer to the same thing. :)

thornahawk


Last edited by Guest on 03 Dec 2007 10:20:43 pm; edited 1 time in total
Back to top
bbolman


Newbie


Joined: 29 Nov 2007
Posts: 7

Posted: 03 Dec 2007 11:46:06 pm    Post subject:

DarkerLine wrote:
The greatest integer function is defined as the greatest integer (duh) which is less than or equal to x. So f(0.6) is 0.

However, the "least integer" function is defined as the least integer which is greater than or equal to x. Here, f(0.6) is 1.

Naturally, this is quite confusing because "greatest integer" returns a smaller result than "least integer." So most people refer to this as "ceiling" and "floor" - floor rounds down to an integer, and ceiling rounds up to an integer.

While the TI-89 has floor() and ceiling() commands, the TI-83+ series calculators have the int() command, so you use int(X) for floor(X) and -int(-X) for ceiling(X). Can you see why -int(-X) works?
[post="116826"]<{POST_SNAPBACK}>[/post]


Definitely counterintuitive, but I get it now. Much appreciated.

I was puzzling out why the -int(-x) works. Does the negative change the operator and what it's looking for? so, it instead looks for the opposite of the greatest integer (which would be the least), that is greater than (flipped from less than) X?
Back to top
thornahawk
μολών λαβέ


Active Member


Joined: 27 Mar 2005
Posts: 569

Posted: 04 Dec 2007 07:57:30 am    Post subject:

Quote:
I was puzzling out why the -int(-x) works. Does the negative change the operator and what it's looking for? so, it instead looks for the opposite of the greatest integer (which would be the least), that is greater than (flipped from less than) X?


See these examples, and your question might be answered:

int(2.2) == 2 (because 2≤2.2<3)

while

int(-2.2) == -3 (because -3≤-2.2<2)

and therefore

-int(-2.2) == 3 (because 3≥2.2>2)

Remember that negating both sides of an inequality changes the "sense" of the inequality sign, e.g. negating both sides of a greater than relation changes ">" into "<". :)

thornahawk
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement