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 can only be either 1 or 0
Say you had a 8 digit Binary number like a byte >>>>>> 0001 1000
Im trying to figure out an equation or what would be the maximum amount of combinations you could get from an 8 digit number
What i mean is.... say you had a two digit binary number,the maximum Bnary combinations that you could have are either
00
01
10
11
Therefore total maximum combinations from a 2 digit Binary number = 4
Example 2
If you had a 3 digit number , maximum Binary Combinations would be
000
001
010
100
101
111
110
011
Therefore total maximum Binary combinations from a 3 digit number = 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 Recently Asked this Question and it was answered thank you manu-fatto and zgnilec they were kind enough to let me know it was a simple equation the answer/equation is 2^digit size.
I guess my next problem is how do i write a small program that can show these combinations in Xcode or NSLog. I'm good with objective C an output I can view like NSLog would be great.
All I know is it would look something like:
int DigitSize=8
int CombinationTotal = 2^8
CombinationSize = NSMutableArray ArraywithCapacity 8;
Output
NSString Combination1 =@"0000 0000";
NSString Combination2 =@"0000 0001";
NSString Combination3 =@"0000 0010";
Nslog @"combination 1 = %@ ,Combination1";
Nslog @"combination 2 = %@ ,Combination2";
Nslog @"combination 3 = %@ ,Combination3";
……
Nslog @"combination 256 = ???? ???? ";
Sorry for the vague language I only started learning programming 3 months ago and I still have a lot of tutorials to go through.
**Im trying to build a data compression algorithm...
basically data compression is about reducing the number of bits ... the lesser the bits the smaller a file is
ie
A file with 700bits is smaller than a file with 900bits
8 bits = 1 byte
1024bytes = 1kb
1024kb = 1 mb
i donno if its even possible but i just thought what if you had an algorithm that could read 1024 bits at a time ...with the equation thats = 2^1024 = math error :( == total number of bit combinations possible
Once you have the total number of combinations you set each combination to a symbol like eg 000101010010101011001011011010101010140010101101000000001110100101100001010100000......0011010 = symbol #
So from now on whenever the computer sees the symbol # it recognises it is equal to the binary number 000101010010101011001011011010101010140010101101000000001110100101100001010100000......0011010
to better understand it ...just think of number plates on a car/vehicle, they are only a few characters but wen you punch them into police database or any car data base more information comes out its the same principle....
basically the symbols are a key to more data
i dont know if it make sense but... in theory if you could read 8388608 bits at a time
8388608 bits = 1megabyte ......
ten symbols could mean 10mb...you could create digital media 2d barcodes its just a thought i had watching starGate lol :)**