
## 5.1 Codification

The codification is based on the function 3. The order of the integer numbers could be different, here the choice is made to number the intersection of all the elements with 1 and the smallest integer among the |Θ| = n bigger integers for the first singleton. In the same time this function give the correspondence between the integer numbers of the practical codification and the Smarandache's codification. This function 3 is based on the Matlab function *nchoosek(tab,k)*
given the array of all the combination of k elements of the vector tab. If the length of tab is n, this function return an array of C
k n rows and k columns.

## Function 3 - Codingtheta Function

function [Theta,Scod]=codingTheta(n) % Code Theta for DSmT framework % % [Theta,Scod]=codingTheta(n) % % Input:
% n = cardinality of Theta %
% Outputs: % Theta = the liste of coded elements in Theta % Scod = the bijection function between the integer of % the coded elements in Theta and the Smarandache codification % % Copyright (c) 2008 Arnaud Martin i=2^n-1; tabInd=[]; for j=n:-1:1 tabInd=[tabInd j];
Theta{j}=[i]; Scod{i}=[j];
i=i-1; end i=i+1; for card=2:n tabPerm=nchoosek(tabInd,card); for j=1:n
[l,c]=find(tabPerm==j); tabi=i.*ones(1,size(l,1)); Theta{j}=[sort(tabi-l') Theta{j}];
for nb=1:size(l,1)
Scod{i-l(nb)}=[Scod{i-l(nb)} j];
end end