Post Reply 
(12C Platinum) Statistical significance calculator
05-10-2023, 11:00 PM (This post was last modified: 06-08-2023 07:19 PM by Tritonio.)
Post: #2
RE: (12C Platinum) Statistical significance calculator
Well, I rewrote it using my suggestions from my previous post.
Code:

001 RCL 1
002 STO 5
003 0
004 STO 1
005 STO 0
006 1
007 RCL 2
008 RCL 0
009 y^x
010 x
011 1
012 RCL 2
013 -
014 RCL 5
015 RCL 0
016 -
017 y^x
018 x
019 RCL 5
020 RCL 0
021 -
022 STO 4
023 x=0 
024 GTO 036
025 RCL 4
026 RCL 0
027 +
028 x<->y
029 /
030 x
031 1
032 STO - 4
033 Rdown
034 RCL 4
035 GTO 023
036 Rdown
037 STO + 1
038 1
039 STO + 0
040 RCL 3
041 x=0
042 GTO 053
043 RCL 0
044 1
045 +
046 x<=y
047 GTO 006
048 RCL 1
049 RCL 5
050 STO 1
051 Rdown
052 GTO 000
053 RCL 1
054 .
055 9
056 9
057 x<->y
058 x<=y
059 GTO 061
060 GTO 069
061 RCL 5
062 1
063 -
064 RCL 0
065 x<=y
066 GTO 006
067 CHG
068 STO / 0
069 RCL 5
070 STO 1
071 RCL 4
072 STO 3
073 GTO 000

It is probably slower than before, I think, I haven't done an actual comparison for the same input. But now it can work even with very big numbers that before would overflow the factorial. For example for 200->STO1, 11/12->STO2 and 0->STO3, it will take I think more than 30 minutes to return an answer but it will actually calculate it! It has wider range than even the original Casio BASIC program.

I am unsure if this way of calculating the nCk (combinations) is accumulating too many rounding errors for big numbers. I may do some comparisons with Wolfram Alpha when I have some time.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (12C Platinum) Statistical significance calculator - Tritonio - 05-10-2023 11:00 PM



User(s) browsing this thread: 1 Guest(s)