is there a program for a ti 84 plus calculator that can determine if a function is even or odd or neither?
adzeko wrote:
is there a program for a ti 84 plus calculator that can determine if a function is even or odd or neither?

You could make a program to just test the points between 1 and 100, it would be right most of the time.
More generally, you need to do algebraic manipulations that aren't possible to do on the 8x series to prove the parity of a function. A numeric approximation like what Ivoah suggests might be correct in many cases, but it is relatively easy to construct a function for which a given numeric approximation is wrong.

Which is to say, I expect there is no existing program to do it.


I had a quick look at ticalc.org and found four programs that purport to do this sort of test. All of them evaluated a Y-function at two points (positive and negative X for some arbitrary X) and made a judgement based on that minimum data.
adzeko wrote:
...neither

I didn't even know that existed. Is it just referring to non-integers?
Kydapoot wrote:
adzeko wrote:
...neither

I didn't even know that existed. Is it just referring to non-integers?


No, it refers to a function that is not symmetric about the origin nor the y-axis.

This tests if Y1 is probably even, odd, or neither:

Code:

0->C
For(A,1,20
|E5(.5-rand->B
Y1(B
C+(Ans=Y1(~B))+2(Ans=~Y1(~B->C
End
If C=20
Then
Disp "EVEN
Else
If C=40
Then
Disp "ODD
Else
Disp "NEITHER
End
End
I suppose this could also be used to test for evenness/oddness (integers only):

In pseudocode:

Number to string routine //I don't actually understand how this works but whatever
Test if last digit is 0,2,4,6, or 8

In real code:

Code:

{0,1→L₁
{0,N→L₂
LinReg(ax+b) Y₁
Equ►String(Y₁,Str1
sub(Str1,1,length(Str1)-3→Str1
if sub(Str1,length(Str1),1)="0" or sub(Str1,length(Str1),1)="2" or sub(Str1,length(Str1),1)="4" or sub(Str1,length(Str1),1)="6" or sub(Str1,length(Str1),1)="8"
then
//Do whatever you want to do if it's even


You could also divide it by two and check if it's a whole number:

Code:

:If not(fPart(X:Then
: // N is an integer and so 2N is even
:Else
: // N is not an integer and so 2N is odd
:End
Kydapoot wrote:
I suppose this could also be used to test for evenness/oddness (integers only):

In pseudocode:

Number to string routine //I don't actually understand how this works but whatever
Test if last digit is 0,2,4,6, or 8

In real code:

Code:

{0,1→L₁
{0,N→L₂
LinReg(ax+b) Y₁
Equ►String(Y₁,Str1
sub(Str1,1,length(Str1)-3→Str1
if sub(Str1,length(Str1),1)="0" or sub(Str1,length(Str1),1)="2" or sub(Str1,length(Str1),1)="4" or sub(Str1,length(Str1),1)="6" or sub(Str1,length(Str1),1)="8"
then
//Do whatever you want to do if it's even


He want's to know if a function is even or odd, not if a number is even or odd.

Testing the evenness of a number is very simple:


Code:
If fPart(N/2
Then
// Odd
Else
// Even
End
jonbush wrote:
He want's to know if a function is even or odd, not if a number is even or odd.
Oh. Sorry!
  
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
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement