Question

In the computer language Python, indicators must start with an upper-case letter, a lower-case

Can you explain your answer and logic step by steps. and state any laws or def. you used Thank you!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Let's consider 8 unfilled positions that we want to fill with characters(comprising of Uppercase letters, lowercase letters, digits and underscore) such that they form identifiers.

_ _ _ _ _ _ _ _ (8 unfilled positions)

Now, to fill the first position, we have 53 characters(26 Uppercase letters + 26 Lowercase letters + 1 underscore).

Therefore, Number of Identifiers with length 1 = 53.

Now, to fill the second position, we have 63 characters(26 Uppercase letters+26 Lowercase letters + 1 Underscore + 10 digits[0-9]).

Therefore, we have 63 characters to fill the second position.

Since an identifier with length 2 will be combination of characters at position 1 and position 2,

the number of identifiers with length 2 = 53(for first position) X 63(for second position) = 53 * 63 = 3339

Similarly, for third position, we have 63 characters.

Number of identifiers with length 3 = 53 * 63 * 63 = 53 * 632

Number of identifiers with length 4 = 53 * 63 * 63 * 63 = 53 * 633

Number of identifiers with length 5 = 53 * 63 * 63 * 63 * 63= 53 * 634

Number of identifiers with length 6 = 53 * 63 * 63 * 63 * 63 * 63= 53 * 635

Number of identifiers with length 7 = 53 * 63 * 63 * 63 * 63 * 63 * 63= 53 * 636

Number of identifiers with length 8 = 53 * 63 * 63 * 63 * 63 * 63 * 63 * 63= 53 * 637

Sum of these will give the total number of words with length <=8 but these will contain the reserved words. We have to subtract the number of reserved words to get the total number of identifiers.

Therefore, number of identifiers with length <=8 = 53 + 53*63 +  53 * 632 + 53 * 633 + 53 * 634 + 53 * 635+ 53 * 636 + 53 * 637 - 29 = 2.1213317 X 1014 . .

Hope you get it.

Add a comment
Know the answer?
Add Answer to:
Can you explain your answer and logic step by steps. and state any laws or def....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT