[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Bits quick question?

You are currently reading a thread in /sci/ - Science & Math

Thread replies: 6
Thread images: 1
File: Victory Loves Preparation.png (1 MB, 1366x768) Image search: [Google]
Victory Loves Preparation.png
1 MB, 1366x768
We have 7 colors of the rainbow and 100 numbers, each color can be associated with a number between 0 to 100 or 1 to 100.

For example (BLUE, 48)

How many bits do we need to represent all possible combinations?

For 7 colors we need 2^3=8
But for the 100 numbers do we need 2^7=128 (which encompasses 100).

Do we need 128 + 8 bits?
Do we need 128 bits alone because 128-100-7=21 extra bits
Do we need less than that?

Thank you.

pic unrelated
>>
Not sure I really understand your question but ill respond regardless
You kinda answered it yourself..
2^3 for 8 combos.. thats 3 bits
2^7 = 128, so 7 bits there

you could to 10 bits, first 3 for color, next 7 for numbers.

does this make sense, if not reword your question so I can understand it better.
>>
you have 7 colours and 100 numbers
the number of possible combinations is 700
[math]2^9 < 700 < 2^{10}[/math]
you need 10 bits.

what the fuck is this for btw?
>>
>>7795796
it's for a class I'm taking intro to computer science
and thank you
>>7795792
basically I need to represent a pair made of (COLOUR, NUMBER)
there are 7 colours and 100 numbers (from 1 to 100) how many bits do I need to represent all possible combinations
>>
>>7795800
you can do it both by just counting up to 700, or by using 3 bits for the colour and 7 for the number, as you (and >>7795792) said.
the latter is probably more intuitive, but the former is better if you want to use the leftover address space to store additional information.
>>
>>7795814
Thank you
Thread replies: 6
Thread images: 1

[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK