Bits, Bytes, and Beyond:
An Introduction

Prof. Dr. Mirco Schoenfeld

Hello

Nice to meet you!

About me

Professor for Data Modelling & Interdisciplinary Knowledge Generation at University of Bayreuth

Computer scientist who enjoys collaborating with people from other disciplines.

Learning objective

My learning objective for you:

  1. Theory
  2. Competency

Learning objective

  1. Theory
    • From theory we learn what computers are capable of
    • We also learn what they can not do well
    • Many concepts have practical applications
  2. Competency
    • You will learn to understand abstract concepts
    • You will learn to think like a computer scientist

Learning by doing

What do you expect from this course?

What do you expect from this course?

Organizational bits

Access to slides, code & material

https://mircoschoenfeld.de/lecture-bits-bytes-and-beyond-foundations-of-computer-science.html

Organizational bits

We use element to stay in touch.

https://element.dmwg.uni-bayreuth.de/

Let’s get started

Exploring “Bits, Bytes, and Beyond”

Bits

Computers are digital.

That means they have two states.

Bits

Haaschreck (2022)

Bits

Smallest unit of information is called a Bit.

Bits

One bit alone doesn’t store much information.

We use sequences of bits to store more.

Bits

Bits Store
00 earth
01 water
10 fire
11 air

Bits

2 bits distinguish 4 things;
3 bits distinguish 8 things;
8 bits, distinguish 256 things.

Bits

How many things can we distinguish
using a bit sequence of length n?

Bytes

A bit sequence of length 8 is called a Byte.

A bit sequence of length 8192 is called a Kilobyte (kB).

One Kilobyte consists of \(1024 = 2^{10}\) Byte.

Bytes

Wait, a kilo-byte has 1024 Bytes? Doesn’t kilo mean 1000?

If you need to precisely refer to 1024 Bytes, say kibibyte.

Kibi means Kilo + Binary.

Bytes

What other names of bit sequences of a certain length do you know?

Beyond

Let’s use these sequences to encode information.

Beyond

How can we represent whole numbers using bit sequences?

Does your scheme support negative numbers?

Beyond

How can we represent texts using bit sequences?

Beyond

Bits Store
00 E (earth)
01 W (water)
10 F (fire)
11 A (air)

EEW \(\hat{=}\) 000001

011011 \(\hat{=}\) WFA

Beyond

How can we encode
“Hello class!”

And how many bits should we use per sign?

ASCII

Shabaz1000 (2024)

Encoding

Some available encodings:

ASCII 7 Bits, 128 characters
ASCII ext. 8 Bits, 256 characters
UNICODE 16 Bits, 65536 characters
ISO 10646 21 Bits, future proof.

Beyond

How can we encode images?

Image encoding

How can we encode this image?

Tantau (2016)

Image encoding

How can we encode this image?

Tantau (2016)

Image encoding

How can we encode this image?

Tantau (2016)

Quick summary

Quick summary

Computers store everything as bit sequences.

Unit Definition What you can store with it
Bit Binary Digit / 0 or 1 not much
Byte 8 Bits Letters in latin alphabet
Kilobyte (kB) 1024 Byte or 1000 Byte small icon, half page of text
Megabyte (MB) 1024 kB or 1000 kB a book, a minute of musik, a second of HD-movie
Gigabyte (GB) 1024 MB or 1000 MB a move, a genome
Terabyte (TB) 1024 GB or 1000 GB Wikipedia
Kibibyte always 1024 Byte

Where do we go from here?

Algorithms

In this lecture, we want to learn about algorithms.

Algorithms

Al-Jabr, or
“The Compendious Book on Calculation”

Al-Khwarizmi (820AD)

Algorithms

A “landmark work in the history of mathematics”, written in 820 by Muhammad ibn Musa al-Khwarizmi.

Al-Khwarizmi (820AD)

Algorithms

Ada Lovelace

Carpenter (1836)

Algorithms

Lovelace describes an algorithm to compute Bernoulli numbers in her notes to Babbage’s lecture notes in 1842.

Lovelace (1842)

Algorithms

It is considered to be the first published algorithm ever specifically tailored for implementation on a computer.

Lovelace (1842)

Algorithms: A definition

Algorithms are finite sequences of instructions,
typically used to solve specific problems.

Algorithms: escape the maze

Escape the maze!

Algorithms vs. Programs

Algorithms

  • abstract description
  • hardware independent
  • language agnostic

Programs

  • concrete list of instructions
  • written in a specific language
  • solve exactly one problem

Structure of algorithms

The vast majority of algorithms use variants of control instructions:

Specifications

Problems can only be solved in a meaningful
way if the problem is clearly defined.

A “clear problem definition”
is called a specification.

Specifications

Specifications should answer the following comprehensively:

  1. what are the relevant framework conditions?
  2. which tools and basic operations are permitted?
  3. when is a solution correct or at least acceptable?

Specifications

https://archive.is/FgxPK

Aim of this lecture

Aim of this lecture

Aim of this lecture

  • We want to learn basic principles of computer science
  • We want to understand algorithms and their complexity
  • We want to understand how algorithms can be improved

Thanks


https://xkcd.com/292/

Acknowledgement

Acknowledgement:

This script is inspired by Tantau (2016).

References

Back to Lecture Website