Convert the binary number 1011 0010 to decimal.
Number Systems And Coding
Question · Easy
Contrapositive, darling: a torch song
Short
What is the decimal number 89 written in binary?
Convert the hexadecimal number 2F to decimal.
Question · Medium
The octal number 17 is converted to binary. What is the result?
How many distinct values can be encoded using 6 bits?
An alphabet contains 32 symbols. How many bits are needed to encode one symbol with a uniform code?
A message of 100 symbols is written using an alphabet of 16 characters. What is the information volume of the message in bits?
Add the binary numbers 1011 and 110. What is the result?
How many bytes are in 2 KiB (kibibytes), using the binary definition 1 KiB = 1024 bytes?
An uncompressed image is 64 x 64 pixels and uses a palette of 256 colors. What is its size in bytes?
A sound is recorded for 10 seconds at a sampling rate of 8000 Hz with 8-bit resolution, single (mono) channel. What is the file size in bytes?
Using a fixed-length code where A=00, B=01, C=10, D=11, decode the bit string 011011.
Which set of codes satisfies the Fano condition (no codeword is a prefix of another), allowing unambiguous decoding?
Question · Hard
Convert the decimal number 100 to hexadecimal.
In which number base does the equation 12 + 12 = 24 hold true?
What is the value of the logical expression NOT(A AND B) when A = true and B = false?
Logic
The logical operation X IMPLIES Y is false only in which case?
How many rows does the truth table of a logical function of 4 variables have?
Which expression is logically equivalent to NOT(A OR B) by De Morgan's law?
The expression A AND (NOT A) always evaluates to what value, regardless of A?
For how many of the 8 possible input combinations of A, B, C is the expression (A OR B) AND C true?
The operation XOR (exclusive or) of A and B is true exactly when:
Which logical operation is represented by the equivalence (biconditional) A <-> B?
Find the smallest non-negative integer x for which the expression (x > 5) IMPLIES (x > 8) is false.
The Sheffer stroke (NAND) of A and B, written A | B, equals which expression?
In Python, what is the value of the expression 17 % 5?
Algorithms And Programming
What does the Python expression 17 // 5 evaluate to?
Consider the loop: s = 0; for i in range(1, 5): s = s + i. What is the final value of s?
What does range(2, 11, 3) produce in Python?
After the code a = 5; b = 3; a, b = b, a, what are the values of a and b?
What is the value of s after: s = 1; for i in range(1, 5): s = s * i ?
In a conditional: if x % 2 == 0: print('A') else: print('B'). What prints when x = 7?
What does the following while loop print: n = 16; while n > 1: n = n // 2; print(n) — how many lines are printed?
Given a = [4, 7, 2, 9, 1], what does a[1] + a[3] equal in Python (0-based indexing)?
What is printed by: a = [3, 1, 4, 1, 5]; print(len(a)) ?
Trace: c = 0; for x in [5, 2, 8, 1, 9]: if x > 4: c = c + 1. What is c?
What value does this function return for find([4, 9, 2, 7])? def find(a): m=a[0]; for x in a: if x>m: m=x; return m
What does s contain after: s = ''; for c in 'abcd': s = c + s ?
In Python, what does 'informatics'[2:5] return?
A recursive function is defined as F(n) = 1 if n <= 1, else n * F(n-1). What is F(4)?
A recursive function prints its argument and then calls itself: def F(n): if n>0: print(n); F(n-2). How many numbers does F(7) print?
The Fibonacci recurrence is F(1)=1, F(2)=1, F(n)=F(n-1)+F(n-2). What is F(6)?
Using dynamic programming, in how many ways can a grasshopper reach cell 4 from cell 1, moving +1 or +2 cells per jump?
A program reads integers until it reads 0, summing positive ones. For input 5, -3, 8, 0, what sum does it report? (negatives ignored, 0 stops)
What is the value of x after x = 0; for i in range(5): x = x + 2; x = x - 1 (both statements inside the loop)?
Which Python statement correctly checks whether the integer n is divisible by 7?
A nested loop runs: for i in range(3): for j in range(4): count += 1. What is count?
Loading more…