summaryrefslogtreecommitdiff
path: root/3808/CH6/EX6.4/Ex6_4.sce
blob: 6b057a4f030abe0f791d9f58b68e63c25790576d (plain)
1
2
3
4
5
6
7
8
9
10
11
//Chapter 06: Counting

clc;
clear;

bits=2 //possible bits are either 0 or 1
ns=7 //no of bits in the string (ie). length of the string
sol=bits**ns

// 7 bits are capable of taking either 0 or 1 so by PRODUCT RULE
mprintf("Total different bit strings of length seven are %d",sol)