Base number system

This is another very important concept in computer science. Particularly because of how data is represented within machines.
Taking up bit arithmetic as a topic separately, let us initiate with understanding what those terms even mean.

In our customary base-ten system, we have digits for the numbers zero through nine. We do not have a single-digit numeral for “ten”. Yes, we write “10”, but its two digits; we have no single solitary digit that stands for “ten”.

There are 10 digits using which we represent all the numbers. Hence the base 10 system.

Similarily, binary number system or base 2 number system has only 2 digits 0, 1. Hex number system or base 16 number system has 16 digits ( 0, 1, 2 .. 9, A, B, .. F ). In general a N base number system has N digits, 0, 1, ... N-1 ( The digits usually after 9 are represented as A, B and so on ).

Base systems like binary and hexadecimal seem a bit strange at first. The key is understanding how different systems “tick over” like an odometer when they are full.

Base 10, our decimal system, “ticks over” when it gets 10 items, creating a new digit. We wait 60 seconds before “ticking over” to a new minute. Hexadecimal and binary are similar, but tick over every 16 and 2 items, respectively.

In computers, numbers are internally represented in binary number system.
We explore more in next slides.

Serious about Learning Programming ?

Learn this and a lot more with Scaler Academy's industry vetted curriculum which covers Data Structures & Algorithms in depth.

Math Problems

Base conversion
Problem Score Companies Time Status
Excel Column Number 175 23:19
Excel Column Title 175 41:11
Digit op
Problem Score Companies Time Status
Palindrome Integer 200
HCL
17:28
Reverse integer 200 28:36
Next Smallest Palindrome! 400 63:07
Combinatorics
Problem Score Companies Time Status
K-th Permutation 200 53:01
City Tour 300
62:31
Grid Unique Paths 375 32:35
Hash search
Problem Score Companies Time Status
Highest Score 200 34:14
Bit play
Problem Score Companies Time Status
Addition without Summation 200 25:37
Number encoding
Problem Score Companies Time Status
Next Similar Number 200 55:40
Rearrange Array 250
49:03
Array dp
Problem Score Companies Time Status
Numbers of length N and value less than K 200
90:00
lock
Topic Bonus
Bonus will be unlocked after solving min. 1 problem from each bucket