summaryrefslogtreecommitdiff
path: root/3544/CH2/EX2.51
diff options
context:
space:
mode:
Diffstat (limited to '3544/CH2/EX2.51')
-rw-r--r--3544/CH2/EX2.51/Ex2_51.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/3544/CH2/EX2.51/Ex2_51.sce b/3544/CH2/EX2.51/Ex2_51.sce
new file mode 100644
index 000000000..a4229ffd3
--- /dev/null
+++ b/3544/CH2/EX2.51/Ex2_51.sce
@@ -0,0 +1,16 @@
+
+// Number of parties and the corresponding number of lock-and-key pairs
+
+printf("Parties involved\tNumber of lock-and-key pairs required")
+
+n = (2:5)
+
+//disp(n)
+num = factorial(n)
+//disp(num)
+den = factorial(2)*factorial(n-2)
+//disp(den)
+
+for i=1:length(num)
+ printf("\n\t%d\t\t\t\t%d\n",n(i),num(i)/den(i))
+end