Binary, base 2, bits, and coin flips

  • Thread starter Thread starter RabbitWho
  • Start date Start date
  • Tags Tags
    Base Binary Bits
Click For Summary

Discussion Overview

The discussion revolves around the concepts of binary representation, bits, and their relationship to coin flips, particularly in the context of information theory and computer science. Participants explore how many bits are needed to represent various outcomes and the implications of binary coding in computers.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant notes that a single coin flip provides 1 bit of information, leading to a discussion about the number of possible outcomes with multiple flips.
  • Another participant confirms that for two coin flips, there are four possible outcomes, corresponding to 2 bits of information.
  • There is a question about how many bits are needed to represent 8 outcomes, with a participant suggesting that log2(8) equals 3 bits.
  • Some participants discuss the difference between representing numbers in binary on a computer versus the theoretical number of bits needed to represent outcomes, noting that additional bits may be required for encoding purposes.
  • Clarifications are made regarding how binary numbers are represented in computers, including the significance of leading zeros in binary notation.
  • One participant expresses confusion about why 011 is not considered a valid representation for the number 3 in certain contexts.
  • A later reply discusses the concept of fixed bit fields in computer coding and how they affect the representation of numbers.
  • Several participants confirm that log2(32) equals 5 bits, and one mentions the largest value representable in an 8-bit chunk (byte).
  • There is a comparison made between decimal and binary systems, highlighting the differences in how positions are weighted in each system.

Areas of Agreement / Disagreement

Participants generally agree on the basic principles of binary representation and the calculations involving bits, but there are nuances regarding the application of these principles in computing that remain contested or unclear.

Contextual Notes

There are unresolved questions regarding the necessity of additional bits for encoding numbers in computer systems and the implications of leading zeros in binary representation.

RabbitWho
Messages
152
Reaction score
18
I am studying psychology and have always been awful at maths (I think it's because I don't have much working memory), I am coming at this as a complete beginner. It is relevant to the Information Processing model of psychology.
_____

The book says: Imagine you throw a coin once.. once it lands you have 1 bit of information. There are two (2) possible results
[log2(2)] = 1 bit

If you throw a coin twice you have two bits of info, there are four possible results (xx,++,+x,x+) (I don't know why they mention the possible results, is that relevant?)
[log2(4)] = 2 bits

Am I right in thinking the 4 in that equation corresponds to the four possible results?

The examples in the book end there, and I have been trying to expand it to check that I understand.

[log2(8)] = how many bits? I guess that question means "How many binary digits do you need to represent 8?" There are 256 possible results.. is that relevant?

[log2(8)] =3 bits if we were talking about coin tosses, and 4 bits on a computer because for some reason they always add one. Am I right?In a computer
zero= 0
one = 1
two = 10
three = 11
four = 100

Why isn't 01 four?
Here I will guessfive = 101
six = 110
seven =111
eight = 1000

log base 2 of 8 is 3 so why do I need 8 digits to represent 8? Why can't I use 011?

A friend suggested that the computer would see 01 as being the same as 10. I am imagining a cent and a euro, they aren't the same coin so a tails with one is not the same as a tails with the other, they aren't interchangeable.. but I would have thought the same went for computer transistors? That is what 1 and 0 represent for computers, right? on and off switches?

_____

Thanks for any help you can give. I have googled it, but all the tutorials I find impart all the information relevant for IT then very quickly go into more advanced things like bytes etc. and don't deal in detail with the basic concept.
 
Computer science news on Phys.org
RabbitWho said:
If you throw a coin twice you have two bits of info, there are four possible results (xx,++,+x,x+) (I don't know why they mention the possible results, is that relevant?)
[log2(4)] = 2 bits

Am I right in thinking the 4 in that equation corresponds to the four possible results?
Yes.
RabbitWho said:
The examples in the book end there, and I have been trying to expand it to check that I understand.

[log2(8)] = how many bits? I guess that question means "How many binary digits do you need to represent 8?" There are 256 possible results.. is that relevant?
You need 3 bits to represent one of eight possibilities.
RabbitWho said:
[log2(8)] =3 bits if we were talking about coin tosses, and 4 bits on a computer because for some reason they always add one. Am I right?
If you are talking about how many states can be coded, it would be 3 on a computer as well. If you are talking about encoding the number 8, then there is an extra bit - because the lowest number encoded by a bit string is usually zero. So you are counting from 0 to 8, nine different value - so you you ned more than 3 bits.
RabbitWho said:
In a computer
zero= 0
one = 1
two = 10
three = 11
four = 100

Why isn't 01 four?
You're not showing both bits.
In a computer
zero= 000
one = 001
two = 010
three = 011
four = 100

So 01 would be 001 - the code for one.
RabbitWho said:
Here I will guessfive = 101
six = 110
seven =111
eight = 1000

log base 2 of 8 is 3 so why do I need 8 digits to represent 8? Why can't I use 011?
Same as above - this time with four bits.
In a computer
five = 0101
six = 0110
seven =0111
eight = 1000

So 011 would be 0011 - the code for three.
RabbitWho said:
A friend suggested that the computer would see 01 as being the same as 10. I am imagining a cent and a euro, they aren't the same coin so a tails with one is not the same as a tails with the other, they aren't interchangeable.. but I would have thought the same went for computer transistors? That is what 1 and 0 represent for computers, right? on and off switches?
There are codes where a different number of bits (coin tosses) are use for different numbers. But in normal computer coding, there are fixed fields of bits - with a preset size. So if your number is eight and you are using 32-bit arithmetic, then you will see 00000000000000000000000000001000.
 
  • Like
Likes   Reactions: RabbitWho
Thank you so much for your help. I think I understand.. So, for example

[log2(32)] = 5 bits?
 
RabbitWho said:
Thank you so much for your help. I think I understand.. So, for example

[log2(32)] = 5 bits?
Yup!
 
  • Like
Likes   Reactions: RabbitWho
RabbitWho said:
Thank you so much for your help. I think I understand.. So, for example

[log2(32)] = 5 bits?
log2(32) = 5, which is a number -- units should not be included.
Using 5 bits you can represent 32 numbers: 0, 1, 2, 3, ..., 31
The binary bit pattern for 31 (ie, in base-2) is 11111, which means ##1 \text{ x } 2^4 + 1 \text{ x } 2^3 + 1 \text{ x } 2^2 + 1 \text{ x } 2^1 + 1 \text{ x } 2^0 = 16 + 8 + 4 + 2 + 1 = 31##
 
  • Like
Likes   Reactions: RabbitWho
RabbitWho said:
Thank you so much for your help. I think I understand.. So, for example

[log2(32)] = 5 bits?
Going the other way: A simple microcontroller handles information in 8 bit chunks (such a chunk is called a byte). What is the largest value you can represent in a byte?
 
  • Like
Likes   Reactions: RabbitWho
In decimal the positions are weighted as powers of 10. In binary the positions are weighted as powers of 2

In decimal 10 symbols (0-9). The positions are (from right to left) 10^0, 10^1, 10^2 or 1, 10, 100
In binary 2 symbols (0-1). The positions are (from right to left) 2^0, 2^1, 2^2 or 1, 2, 4

Totally analagous
 
  • Like
Likes   Reactions: RabbitWho

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
3
Views
6K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K