Post Reply 
(12C Platinum) Combination Permutation
01-14-2020, 07:18 AM (This post was last modified: 01-15-2020 06:18 AM by Gamo.)
Post: #4
RE: (12C Platinum) Combination Permutation
Combinations and Permutation Version IV
Program on RPN mode

mCn for Combination
mPn for Permutation

Where m can be larger than 69

For Permutation, n must be larger than 1 if user input n = 1
result will be wrong answers otherwise assumeing that if it is
mP1 then the answer is m

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

Procedure: RPN mode FIX 0

Combination: Strat at begining of program: [GTO] 000 or [PRGM]

mCn

m [ENTER] n [R/S] ---> Answer

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

Permutation: Goto Line [GTO] 036

mPn

m [R/S] n [R/S] ---> Answer

---------------------------------------
Example: FIX 0

150C5

[PGRM] or [GTO] 000

150 [ENTER] 5 [R/S] display 591,600,030.
--------------------------------------
80P5

[GTO] 036

80 [R/S] display 80
5 [R/S] display 2,884,801,920.
---------------------------------------
For faster speed on Permutation of m < 70

[GTO] 075

m [R/S] n [R/S] ---> Answer
--------------------------------------
Program: RPN mode
Code:

001  -
002 LSTx
003 X≤Y
004 GTO 032
005 STO 0
006  1
007 STO 1
008  +
009 STO 2
010 CLx
011 X≤Y
012 GTO 014
013 GTO 034
014 Rv
015  1
016 RCL 1
017  +
018 STO 1
019 X≤Y
020 GTO 023
021 RCL 2
022 GTO 000
023 RCL 0
024 X<>Y
025  +
026 LSTx
027  ÷
028 RCL 2
029  x
030 STO 2
031 GTO 014
032 X<>Y
033 GTO 005
034  1
035 GTO 000  // End routine of Combination
--------------------
036 ENTER
037 STO 0
038 R/S
039 X≤Y
040 GTO 042
041 GTO 071
042 X≤Y
043 GTO 046
044  0
045  ÷
046  1
047 X≤Y
048 GTO 050
049 GTO 068
050 CLx
051 X≤Y
052 GTO 054
053 GTO 073
054  +
055  -
056  1
057  +
058  x
059 LSTx
060 RCL 0
061  1
062  -
063 X≤Y
064 GTO 068
065 GTO 066
066 Rv
067 GTO 056
068 Rv
069 Rv
070 GTO 000
071 n!
072 GTO 000
073  1
074 GTO 000  // End routine of Permutation
-------------------
075 ENTER
076 n!
077 X<>Y
078 R/S
079  -
080 n!
081  ÷ 
082 GTO 000  // End routine of fast Permutation

Gamo 1/2020
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (12C Platinum) Combination Permutation - Gamo - 01-14-2020 07:18 AM



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