# At the Parking Lot

Alice and Bob started working part-time parking lot attendants. Bob was managing a car when Alice arrived late on the first day at work.

A: I'm sorry for being late. How many cars have come in?

B: I will make a quiz on it. Why don't you guess the number of cars?

A: You are giving me a problem to solve?

B: Right. Every car has its plate number and the numbers have special relation.

A: So, do you want me to figure out the number of cars from that relation?

B: Yes, conditions are as follows.

Condition 1: Any two cars must share only one digit.

Condition 2: There must be exactly one more car with the equal digit that two cars have.

A: (after thinking) Three cars?

B: Why do you think the answer is three cars?

A: For example, if there are three cars with the plate numbers 1, 12, and 13, any two cars have 1, and there are exactly three cars which has 1 in the plate number.

B: Oh, there is one more condition.

Condition 3: There are more than three cars.

How many cars were in the parking lot when Alice arrived?

Added remark: It's not very hard to construct examples for 7 cars. Could you show the reason why other number cannot be an answer?

• do all cars have 4 digits? – Ivo Beckers Jan 26 '15 at 13:14
• @IvoBeckers Sorry. Any number of digits. – P.-S. Park Jan 26 '15 at 13:17
• I think the conditions are unclear. Wouldn't adding 1114 to the other three be correct? or 1115 to that? – Ivo Beckers Jan 26 '15 at 13:20
• If two cars (1111 and 1112) have a digit 1 in common, there is only one more car having a digit 1. So neither 1114 nor 1115 exists. – P.-S. Park Jan 26 '15 at 13:23
• It's a trick question. Mallory was there, and she intercepted Bob's messages, and sent modified conditions to Alice without either of them knowing. – KSmarts Jan 26 '15 at 21:50

If any two cars share exactly 1 digit, we can get up to $7 cars$:

Based on our restrictions, we can use at most 30 digits. A 3-digit number can match at most 6 other numbers (2 for each digit). A 4-digit number can match at most 8 other numbers, but at that point, we need more than the 30 available digits.

1__'s then 2__'s then 3__'s
$123, 145, 167, 246, 257, 347, 356$

or

Starting from 12, 13, 14
$125, 136, 147, 234, 267, 537, 564$

Old:

So, if I have it right:

• Any two cars share at least 1 digit
• 1 and only 1 other car shares that digit

So, it looks like we need some sort of groups of 3.

Might be able to get away with 5 cars: 12, 13, 14, 234, 432

• Sorry for my poor English. Any two cars should share only one digit. In your answer, 234 and 432 share three digits. – P.-S. Park Jan 26 '15 at 14:33
• I think I'm missing something. Can you explain the "30 digit" limitation? – Nick2253 Jan 26 '15 at 17:52
• Each digit can at most be used 3 times. That's because if there is ever a pair of those digits, there must be 1 (and only 1) more. Since there are 10 total digits, 30 is the max. – JonTheMon Jan 26 '15 at 19:00

7 cars

Example with 7 cars: 156 267 137 124 235 346 457

• Good! But, your second example is not correct: 124 and 568 share no digits. – P.-S. Park Jan 26 '15 at 14:42
• yeah you're right. guess 7 is the only option then :) I'll edit it – Ivo Beckers Jan 26 '15 at 14:42

ORIGINAL ANSWER before question was ammended: I'm having trouble understanding the clauses ... doesn't

Condition 1: Any two cars must have an equal digit. Condition 2: There must be exactly one more car with the equal digit that two cars have.

Just mean that that there must be 3 cars that share a digit?

In which case the answer is 4:

12, 13, 23, 123

Each digit is shared by two cars, plus exactly one more car.

EDITED ANSWER: 7, if only a single digit can be shared between two cars.

2, 3, 4, 12, 13, 14, 234

• FYI, OP edited just after you posted to change condition 1 to "Any two cars must share only one digit." This sounds correct for the original wording. – Set Big O Jan 26 '15 at 14:34
• Sorry for my poor English. Your answer shows that 23 and 123 share two digits. – P.-S. Park Jan 26 '15 at 14:34
• your edited answer has 4 times 1 – Ivo Beckers Jan 26 '15 at 14:56