二进制数字如何解决V2 [英] Binary Numbers what is the solution V2
问题描述
有谁知道如何解决这个问题?任何帮助将是巨大的......我似乎无法让我的头周围。
Does anyone know how I can solve this problem ? any help would be great...... i cant seem to get my head around it.
正如你所知道的二进制只能是1或0
As you know Binary can only be either 1 or 0
假设你有一个8位二进制数像一个字节>>>>>> 0001 1000
Say you had a 8 digit Binary number like a byte >>>>>> 0001 1000
我试着去找出一个方程式或什么是你可以从一个8位数字的组合获得的最大金额
Im trying to figure out an equation or what would be the maximum amount of combinations you could get from an 8 digit number
我的意思是说....你有一个两位二进制数,最大Bnary组合,你可以有要么
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结果
从2位二进制数。因此总的最大组合= 4
11
Therefore total maximum combinations from a 2 digit Binary number = 4
例2
如果你有一个3位数,最大二进制组合将是
If you had a 3 digit number , maximum Binary Combinations would be
000
001
010
100
101
111
110
011结果
从3位数因此总的最大二进制组合= 8
011
Therefore total maximum Binary combinations from a 3 digit number = 8
例3
如果它是一个4位数字,最大二元组合,你可以有要么
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最大总组合= 12
1001 Total maximum combination = 12
最近,我问了这个问题,它是回答谢谢马努 - fatto和zgnilec他们很友好地让我知道这是一个简单的等式答案/公式为2 ^位数的大小。
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.
我想我的下一个问题是我如何写一个小程序,可以显示在X code或NSLog的组合。我擅长与目标C的输出,我可以像查看NSLog的将是巨大的。
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;
输出
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 = ???? ???? ";
很抱歉的模糊语言,我只3个月前开始学习编程,我仍然有很多教程的经历。
Sorry for the vague language I only started learning programming 3 months ago and I still have a lot of tutorials to go through.
**我试着去建立一个数据COM pression算法...
**Im trying to build a data compression algorithm...
基本上数据玉米pression为约减少比特数...比特的较小的小的文件是
basically data compression is about reducing the number of bits ... the lesser the bits the smaller a file is
即
使用700bits的文件比使用900bits的文件
A file with 700bits is smaller than a file with 900bits
8位= 1字节
1024bytes = 1KB
1024bytes = 1kb
1024KB = 1 MB
1024kb = 1 mb
我唐诺如果甚至有可能,但我只是想,如果你有什么样的算法,可以一次读取1024位......与方程多数民众赞成= 2 ^ 1024 =数学错误:( ==位组合的总数可能的
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
一旦你有组合的总数将每个组合设置为例如像000101010010101011001011011010101010140010101101000000001110100101100001010100000的象征...... 0011010 =符号#
Once you have the total number of combinations you set each combination to a symbol like eg 000101010010101011001011011010101010140010101101000000001110100101100001010100000......0011010 = symbol #
因此,从现在起只要计算机看到它识别它等于二进制数000101010010101011001011011010101010140010101101000000001110100101100001010100000符号#...... 0011010
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
我不知道这是否有道理,但是......从理论上讲,如果你能一次读取8388608位
i dont know if it make sense but... in theory if you could read 8388608 bits at a time
8388608位= 1megabyte ......
8388608 bits = 1megabyte ......
10个符号可能意味着10MB ...你可以创建数字媒体二维条码codeS
它只是一个想我已经看星际笑:)**
ten symbols could mean 10mb...you could create digital media 2d barcodes its just a thought i had watching starGate lol :)**
推荐答案
2的8次方,其中8位数。
2 to the power of 8, where 8 is number of digits.
编辑 - 只读第一个问题:)
Edit- only read first question :)
创建功能,将显示一个整数作为二进制
create function that will display an integer as binary
for (i = 0; i < pow(2,n), i++)
{
displayBits(i);
}
这篇关于二进制数字如何解决V2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!