To find the number of times the digit '3' appears in all the numbers from 1 to 1000, we can break it down into three cases based on the number of digits in the numbers: single-digit, two-digit, and three-digit numbers.
### Step-by-step Solution:
1. **Count the occurrences of '3' in single-digit numbers (1 to 9)**:
- The only single-digit number that contains '3' is '3' itself.
- **Count**: 1 occurrence.
2. **Count the occurrences of '3' in two-digit numbers (10 to 99)**:
- We can have '3' in the tens place or the units place.
- **Tens Place**: The numbers are 30 to 39 (10 numbers: 30, 31, 32, 33, 34, 35, 36, 37, 38, 39). This gives us 10 occurrences.
- **Units Place**: The numbers are 13, 23, 33, 43, 53, 63, 73, 83, 93 (9 numbers). This gives us 9 occurrences.
- **Total for two-digit numbers**: 10 (from tens place) + 9 (from units place) = 19 occurrences.
3. **Count the occurrences of '3' in three-digit numbers (100 to 999)**:
- We can have '3' in the hundreds place, tens place, or units place.
- **Hundreds Place**: The numbers are 300 to 399 (100 numbers). This gives us 100 occurrences.
- **Tens Place**: For every hundred (100-199, 200-299, 300-399, ..., 900-999), '3' can appear in the tens place as 130-139, 230-239, 330-339, 430-439, 530-539, 630-639, 730-739, 830-839, 930-939 (10 numbers for each hundred). There are 9 hundreds, so this gives us 9 * 10 = 90 occurrences.
- **Units Place**: Similar to the tens place, '3' can appear in the units place as 103, 113, 123, 133, ..., 993 (10 numbers for each hundred). Again, there are 9 hundreds, giving us 9 * 10 = 90 occurrences.
- **Total for three-digit numbers**: 100 (from hundreds place) + 90 (from tens place) + 90 (from units place) = 280 occurrences.
4. **Combine all occurrences**:
- Single-digit: 1 occurrence
- Two-digit: 19 occurrences
- Three-digit: 280 occurrences
- **Total occurrences of '3' from 1 to 1000**: 1 + 19 + 280 = 300.
### Final Answer:
The digit '3' appears **300 times** in all the numbers from 1 to 1000.