0
votes

Does anyone know how I can solve this problem? Any help would be great...... I cant seem to get my head around it.

As you know binary digits can only be either 1 or 0.

Say you had a 8 digit Binary number like a byte >>>>>> 0001 1000.

I'm trying to figure out an equation for the number of combinations you could get from an 8 digit binary number.

For example, if you had a two digit binary number, the binary combinations that you could have are:

00

01

10

11

Therefore the total combinations from a 2 digit binary number is 4.

Example 2

If you had a 3 digit number, the combinations would be:

000

001

010

100

101

111

110

011

Therefore the number of binary combinations from a 3 digit number is 8.

Example 3

If it were a 4 digit number, maximum binary combinations that you could have are either

0000

0001

0010

0100

1000

0111

0110

1111

1110

1101

1011

1001 Total maximum combination = 12

I Guess in a nutshell what im asking is .... if i had any number 6,7,15,8 or any number... how could i calculate the total maximum Binary combinations is there an equation to it ... I cant figure it out..ive tried for days now ;(

2
what does it have to do with objective-c or Xcode? - vikingosegundo
it just my prefared language i havnt learnt other computer languages yet like java , C and the many around ... im tryng to build an algorithm - 13rianC
both numeric representation and algorithms are language agnostic - vikingosegundo
btw: four bit can decode 16 values, not twelve. form 0 to 15 - vikingosegundo
0:0000, 1:0001, 2:0010, 3:0011, 4:0100, 5:0101, 6:0110, 7:0111, 8:1000, 9:1001, 10:1010, 11:1011, 12:1100, 13:1101, 14:1110, 15:1111 - vikingosegundo

2 Answers

2
votes

The number of numbers composed by d digits in base b is

b^d
1
votes

n - number of digits
b - base
^ - power

b^n

So your base is 2 (binary), and u want to check combinations for 8 digit number

2^8 = 256