Skip to main content
Ch. 4 - Probability
Triola - Elementary Statistics 14th Edition
Triola14th EditionElementary StatisticsISBN: 9780137366446Not the one you use?Change textbook
Chapter 4, Problem 4.4.37

Computer Variable Names A common computer programming rule was that names of variables must be between one and eight characters long. The first character can be any of the 26 letters, while successive characters can be any of the 26 letters or any of the 10 digits. For example, allowable variable names include A, BBB, and M3477K. How many different variable names are possible? (Ignore the difference between uppercase and lowercase letters.)

Verified step by step guidance
1
Step 1: Understand the problem. We need to calculate the total number of possible variable names that follow the given rules: the name must be between 1 and 8 characters long, the first character must be one of the 26 letters, and the remaining characters (if any) can be one of the 26 letters or 10 digits (a total of 36 possible characters).
Step 2: Calculate the number of possible variable names for each length. For a variable name of length 1, there are 26 possibilities (only the first character matters). For a variable name of length 2, the first character has 26 possibilities, and the second character has 36 possibilities, so the total is 26 × 36. Similarly, for a variable name of length 3, the total is 26 × 36 × 36, and so on up to length 8.
Step 3: Write the general formula for the number of variable names of length n. For a variable name of length n, the total number of possibilities is 26 × 36^(n-1), where the first character has 26 options and each of the remaining (n-1) characters has 36 options.
Step 4: Sum the possibilities for all lengths from 1 to 8. The total number of variable names is the sum of the possibilities for each length: 26 + (26 × 36) + (26 × 36^2) + ... + (26 × 36^7).
Step 5: Use the formula for the sum of a geometric series to simplify the calculation. The series can be expressed as 26 × [1 + 36 + 36^2 + ... + 36^7]. This is a geometric series with the first term a = 1, common ratio r = 36, and 8 terms. The sum of the series is given by S = a × (1 - r^n) / (1 - r), where n is the number of terms. Substitute the values to compute the total number of variable names.

Verified video answer for a similar problem:

This video solution was recommended by our tutors as helpful for the problem above.
Video duration:
3m
Was this helpful?

Key Concepts

Here are the essential concepts you must grasp in order to answer the question correctly.

Combinatorics

Combinatorics is a branch of mathematics dealing with counting, arrangement, and combination of objects. In this context, it helps determine the total number of valid variable names by calculating the different ways to arrange letters and digits within the specified constraints.

Permutations and Combinations

Permutations refer to the arrangement of objects where order matters, while combinations refer to selections where order does not matter. For variable names, we focus on permutations since the order of characters in the name is significant, especially given the rules for the first character and subsequent characters.
Recommended video:
03:18
Permutations vs. Combinations

Base Counting Principle

The Base Counting Principle states that if one event can occur in 'm' ways and a second can occur independently in 'n' ways, then the two events can occur in 'm × n' ways. This principle is applied here to calculate the total number of variable names by multiplying the number of choices for each character position.
Recommended video:
04:04
Fundamental Counting Principle
Related Practice
Textbook Question

Phone Numbers Current rules for telephone area codes allow the use of digits 2–9 for the first digit, and 0–9 for the second and third digits, but the last two digits cannot both be 1 (to avoid confusion with area codes such as 911). How many different area codes are possible with these rules? That same rule applies to the exchange numbers, which are the three digits immediately preceding the last four digits of a phone number. Given both of those rules, how many 10-digit phone numbers are possible? Given that these rules apply to the United States and Canada and a few islands, are there enough possible phone numbers? (Assume that the combined population is about 400,000,000.)

306
views
Textbook Question

In Exercises 9–20, use the data in the following table, which lists survey results from high school drivers at least 16 years of age (based on data from “Texting While Driving and Other Risky Motor Vehicle Behaviors Among U.S. High School Students,” by O’Malley, Shults, and Eaton, Pediatrics, Vol. 131, No. 6). Assume that subjects are randomly selected from those included in the table. Hint: Be very careful to read the question correctly.

Drinking and Driving If one of the high school drivers is randomly selected, find the probability of getting one who drove when drinking alcohol.

97
views
Textbook Question

Same Birthdays If 25 people are randomly selected, find the probability that no 2 of them have the same birthday. Ignore leap years.

214
views
Textbook Question

In Exercises 21-28, find the probability and answer the questions.


Social Networking In a Pew Research Center survey of Internet users, 3732 respondents say that they use social networking sites and 1380 respondents say that they do not use social networking sites. What is the probability that a randomly selected person uses a social networking site? Does that result suggest that it is likely (with a probability of 0.5 or greater) for someone to use social networking sites?

128
views
Textbook Question

In Exercises 13–20, express the indicated degree of likelihood as a probability value between 0 and 1.



Randomness When using a computer to randomly generate the last digit of a phone number to be called for a survey, there is 1 chance in 10 that the last digit is zero

177
views
Textbook Question

In Exercises 33–40, use the given probability value to determine whether the sample results are significant.



Voting Repeat Exercise 33 after replacing 40 Democrats being placed on the first line of voting ballots with 27 Democrats being placed on the first line. The probability of getting a result as high as 27 is 0.029792.

103
views