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

Bits quick question?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 6
Thread images: 1

File: Victory Loves Preparation.png (1MB, 1366x768px) Image search: [Google]
Victory Loves Preparation.png
1MB, 1366x768px
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 posts: 6
Thread images: 1


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.