•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FileFACT(n)
VARIAT(n,k)
COMBIN(n,k)

n, k: iexp

Commands from the field of combinatorics.

FACT(n) returns the factorial of a natural number n (n!). A factorial is the
product of the first n natural numbers, where 0!=1.

VARIAT(n,k) returns the number of variations of n elements to the k-th order
without repetition. The number of variations of n elements to the k-th order
without repition is defined as:

    VARIAT(n,k)=n!/(n-k)!

    When k > n an error is reported.

COMBIN(n,k) returns the number of combinations of n elements to the k-th order
without repetition. The number of combinations of n elements to the k-th order
without repition is defined as:

    COMBIN(n,k)=n!/((n-k)!*k!)

    When k > n an error is reported.

Example:

    x=FACT(6)
    y=VARIAT(6,2)
    z=COMBIN(6,2)
    PRINT x,y,z
    ~INP(2)

--> The values 720, 30, and 15 appear on the screen. A key is then waited for.