In: Computer Science
1. Find the big−O, big−Ω estimate for x7y3+x5y5+x3y7. [Hint: Big-O, big- Θ, and big-Omega notation can be extended to functions in more than one variable. For example, the statement f(x, y) is O(g(x, y)) means that there exist constants C, k1, and k2 such that|f(x, y)|≤C|g(x, y)|whenever x > k1 and y > k2]
2. Find a div b and a mod b when:
(a) a = 30303, b = 333
(b) a = −765432, b = 3827
3. Convert each of the following to their respective Decimal, Octal, Hexadecimal and binary representation
(a) 742)8
(b) (1011)2
(c) (47)10
(d) (3EAC)16
Solution
3)
(a) 742)8
Convert to decimal
To convert octal number 742 to decimal, follow these two steps:
Start from one's place in 742 : multiply ones place with 8^0, tens place with 8^1, hundreds place with 8^2 and so on from right to left
Add all the product we got from step 1 to get the decimal equivalent of 742.
Using the above steps, here is the work involved in the solution for converting 742 to decimal number (Don't forget that we start from ones place to so on...)
Decimal equivalent of
"2" = 2 × 8^0 = 2
Decimal equivalent of "4" = 4 × 8^1 = 32
Decimal equivalent of "7" = 7 × 8^2 = 448
Decimal equivalent of "742" = 2+32+448
742 = 482
Here is the final
answer, The octal number 742 converted to decimal is therefore
equal to:
482
---
Convert to Hexadecimal
First write 742 in binary
7 is 111
4 is 100
2 is 010
742 is 111100010
that is
1 1110 0010
convert back to hexadecimal
1 is 1
1110 is E
0010 is 2
Therefore Answer is
1E2
---
Convert to binary
7 is 111
4 is 100
2 is 010
742 is 111100010
Therefore
Answer is
111100010
---
(b) (1011)2
Convert to decimal
To convert binary number 1011 to decimal, follow these two steps:
Start from one's place in 1011 : multiply ones place with 2^0, tens place with 2^1, hundreds place with 2^2 and so on from right to left
Add all the product we got from step 1 to get the decimal equivalent of 1011.
Using the above steps, here is the work involved in the solution for converting 1011 to decimal number (Don't forget that we start from ones place to so on...)
Decimal equivalent of
"1" = 1 × 2^0 = 1
Decimal equivalent of "1" = 1 × 2^1 = 2
Decimal equivalent of "0" = 0 × 2^2 = 0
Decimal equivalent of "1" = 1 × 2^3 = 8
Decimal equivalent of "1011" = 1+2+0+8
1011 = 11
Here is the final
answer, The binary number 1011 converted to decimal is therefore
equal to:
11
---
Convert to octal
1011
divide into 3bits from the left
1 011
001 011
001 is 1
011 is 3
therefore answer is
13
---
1011 is
B in Hexadecimal
therefore answer is
B
---
(c) (47)10
Convert to Octal
To convert decimal number 47 to octal, follow these steps:
Divide 47 by 8 keeping notice of the quotient and the remainder.
Continue dividing the quotient by 8 until you get a quotient of zero.
Then just write out the remainders in the reverse order to get octal equivalent of decimal number 47.
Using the above steps, here is the work involved in the solution for converting 47 to octal number:
47 / 8 = 5 with
remainder 7
5 / 8 = 0 with remainder 5
Then just write down
the remainders in the reverse order to get the answer, The decimal
number 47 converted to octal is therefore equal to :
57
----
Convert to Hexadecimal
To convert decimal number 47 to hexadecimal, follow these steps:
Divide 47 by 16 keeping notice of the quotient and the remainder.
Continue dividing the quotient by 16 until you get a quotient of zero.
Then just write out the remainders in the reverse order to get hexadecimal equivalent of decimal number 47.
Using the above steps, here is the work involved in the solution for converting 47 to hexadecimal number:
47 / 16 = 2 with
remainder 15 (F)
2 / 16 = 0 with remainder 2
Then just write down
the remainders in the reverse order to get the answer, The decimal
number 47 converted to hexadecimal is therefore equal to :
2F
----
Convert to binary
To convert decimal number 47 to binary, follow these steps:
Divide 47 by 2 keeping notice of the quotient and the remainder.
Continue dividing the quotient by 2 until you get a quotient of zero.
Then just write out the remainders in the reverse order to get binary equivalent of decimal number 47.
Using the above steps, here is the work involved in the solution for converting 47 to binary number:
47 / 2 = 23 with
remainder 1
23 / 2 = 11 with remainder 1
11 / 2 = 5 with remainder 1
5 / 2 = 2 with remainder 1
2 / 2 = 1 with remainder 0
1 / 2 = 0 with remainder 1
Then just write down
the remainders in the reverse order to get the answer, The decimal
number 47 converted to binary is therefore equal to :
101111
---
(d) (3EAC)16
Convert to Decimal
To convert hexadecimal number 3EAC to decimal, follow these two steps:
Start from one's place in 3EAC : multiply ones place with 16^0, tens place with 16^1, hundreds place with 16^2 and so on from right to left
Add all the product we got from step 1 to get the decimal equivalent of 3EAC.
Using the above steps, here is the work involved in the solution for converting 3EAC to decimal number (Don't forget that we start from ones place to so on...)
Decimal equivalent of
"C" = (C) 12 × 16^0 = 12
Decimal equivalent of "A" = (A) 10 × 16^1 = 160
Decimal equivalent of "E" = (E) 14 × 16^2 = 3584
Decimal equivalent of "3" = 3 × 16^3 = 12288
Decimal equivalent of "3EAC" = 12+160+3584+12288
3EAC = 16044
Here is the final
answer, The hexadecimal number 3EAC converted to decimal is
therefore equal to:
16044
---
Convert to Octal
3EAC
First convert to binary
3 is 0011
E is 1110
A is 1010
C is 1100
now write
3EAC is 0011111010101100
now divide into 3 bits from the left
0 011 111 010 101 100
37254
---
Convert to Binary
3 is 0011
E is 1110
A is 1010
C is 1100
3EAC16 = 111110101011002
---
Answered part 3 completely with detailed explanation
all the best