# Basic Mathematics Assignment Two
---
### **Question (a)
Given:
- Universal set \( U = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\} \)
- \( A = \{1, 2, 3, 4\} \)
- \( B = \{3, 4, 5, 6\} \)
**i. Find \( A^c \cup B \)**
- \( A^c = U - A = \{5, 6, 7, 8, 9, 10\} \)
- \( A^c \cup B = \{5, 6, 7, 8, 9, 10\} \cup \{3, 4, 5, 6\} = \{3, 4, 5, 6, 7, 8, 9, 10\} \)
**Answer:** \( \{3, 4, 5, 6, 7, 8, 9, 10\} \)
**ii. Find \( A \cap B^c \)**
- \( B^c = U - B = \{1, 2, 7, 8, 9, 10\} \)
- \( A \cap B^c = \{1, 2, 3, 4\} \cap \{1, 2, 7, 8, 9, 10\} = \{1, 2\} \)
**Answer:** \( \{1, 2\} \)
---
### **Question (b)**
**Convert \( 67_{10} \) to binary.**
**Solution:**
Divide by 2 repeatedly and note remainders:
1. \( 67 ÷ 2 = 33 \) remainder \( 1 \)
2. \( 33 ÷ 2 = 16 \) remainder \( 1 \)
3. \( 16 ÷ 2 = 8 \) remainder \( 0 \)
4. \( 8 ÷ 2 = 4 \) remainder \( 0 \)
5. \( 4 ÷ 2 = 2 \) remainder \( 0 \)
6. \( 2 ÷ 2 = 1 \) remainder \( 0 \)
7. \( 1 ÷ 2 = 0 \) remainder \( 1 \)
Read remainders from bottom to top: \( 1000011_2 \).
**Answer:** \( 1000011_2 \)
---
### **Question (c)**
**Solve \( x^2 + 5x - 6 = 0 \).**
**Solution:**
Factorize the quadratic equation:
\( x^2 + 5x - 6 = (x + 6)(x - 1) = 0 \)
Thus, the solutions are:
\( x + 6 = 0 \implies x = -6 \)
\( x - 1 = 0 \implies x = 1 \)
**Answer:** \( x = -6 \) or \( x = 1 \)
---
### **Question (d)**
**Explain: "A set should be well-defined."**
**Answer:**
A set is well-defined if its elements are clearly and unambiguously specified, so there is no confusion about
whether an object belongs to the set or not. For example, "the set of all even numbers" is well-defined, while
"the set of all large numbers" is not, because "large" is subjective.
---
### **Question (e)**
**Evaluate \( 54_{10} - 31_{10} \) using two's complement.**
**Solution:**
1. Convert numbers to 8-bit binary:
- \( 54_{10} = 00110110_2 \)
- \( 31_{10} = 00011111_2 \)
2. Find two's complement of \( 31 \):
- Invert bits: \( 11100000 \)
- Add 1: \( 11100001 \)
3. Add \( 54 \) and two's complement of \( 31 \):
```
00110110
+ 11100001
---------
100010111 (Discard overflow bit)
```
Result: \( 00010111_2 = 23_{10} \).
**Answer:** \( 23_{10} \)
---
**Question (f)
**Perform the following conversions:**
**i. \( 67_8 \) to binary**
- Convert each octal digit to 3-bit binary:
- \( 6_8 = 110_2 \)
- \( 7_8 = 111_2 \)
- Combine: \( 110111_2 \).
**Answer:** \( 110111_2 \)
**ii. \( EBAF6_{16} \) to decimal**
- Convert each hex digit to decimal and multiply by \( 16^n \):
- \( E = 14 \), \( B = 11 \), \( A = 10 \), \( F = 15 \), \( 6 = 6 \)
- Calculation:
\( 14 \times 16^4 + 11 \times 16^3 + 10 \times 16^2 + 15 \times 16^1 + 6 \times 16^0 \)
\( = 917504 + 45056 + 2560 + 240 + 6 = 965366_{10} \).
**Answer:** \( 965366_{10} \)
**iii. \( 100010010.01101_2 \) to decimal**
- Split into integer and fractional parts:
- Integer: \( 1 \times 2^8 + 0 \times 2^7 + \ldots + 1 \times 2^1 + 0 \times 2^0 = 256 + 16 + 2 = 274 \)
- Fraction: \( 0 \times 2^{-1} + 1 \times 2^{-2} + \ldots + 0 \times 2^{-5} = 0.25 + 0.125 + 0.03125 = 0.40625 \)
- Combine: \( 274.40625_{10} \).
**Answer:** \( 274.40625_{10} \)
**iv. \( 765_{10} \) to Gray code**
1. Convert \( 765_{10} \) to binary: \( 1011111101_2 \).
2. Apply Gray code conversion (XOR each bit with the next):
- \( 1 \) (MSB remains the same)
- \( 1 \oplus 0 = 1 \)
- \( 0 \oplus 1 = 1 \)
- \( 1 \oplus 1 = 0 \)
- \( 1 \oplus 1 = 0 \)
- \( 1 \oplus 1 = 0 \)
- \( 1 \oplus 1 = 0 \)
- \( 1 \oplus 0 = 1 \)
- \( 0 \oplus 1 = 1 \)
- Result: \( 1110000111_{\text{Gray}} \).
**Answer:** \( 1110000111_{\text{Gray}} \)
---
**End of Assignment**