In how many ways can 5 objects be placed in 3 groups? Consider this question:

In how many ways can $5$ tourists be placed in $3$ different hotels, such that there is at least one tourist in each hotel?

To start working on this, I removed the lower bound on the number of tourists in a hotel. I reasoned that any tourist can be placed in any of the $3$ hotels, resulting in $5\times 3=15$ permutations.
However, the correct answer with the lower bound is $150$, which is more than $15$.
Obviously, I am undercounting by a large amount. How?
 A: This is not correct. Without the lower bound you can assign one hotel to one by one the tourists. So, if you line up the tourists in a line and record the hotel you will get: $3$ possibilities for each one, giving you $3\times 3\times \cdots \times 3=3^5.$ 
Notice that this is the same as the number of functions from $[5]$ to $[3]$ (you are making a functional choice, i.e., you dont want to send one tourist to two different hotels).

Now, with the lower bound, you have to take away the times that you missed one of the hotels. The problem becomes in that you will be overcounting so you have to include and exclude. You will get $3^5-3\cdot 2^5+3,$ where the $2^5$ is choosing out of now $2$ hotels(you are missing one of the $3$ hotels). The last $3$ is because when you take out the hotels you are overcounting the choice in which you send all the tourist to the same hotel!
In fancy terms this is the number of surjective functions from $[5]$ to $[3]$ that can be established using the Stirling numbers of second kind as ${5\brace 3}\cdot 3!$
A: The number 150 was very logically solved by Phicar. For fun, I wrote a Python that confirms it.
from random import seed
from random import randint
seed(1)
Number_of_Tourists = 5
Number_of_Hotels = 3

class Permutation():
    def __init__(self):
        self.make_permutation()

    def make_permutation(self):
        while True:
            self.tourists =[]
            for t in range(Number_of_Tourists):
                self.tourists.append(randint(1, Number_of_Hotels))
            self.hotels = {}
            for t in self.tourists:
                if t not in self.hotels:
                    self.hotels[t] = 1
            # Enforce lower bound, each hotel as at least one tourist
            if len(self.hotels) == Number_of_Hotels:
                break

def find_permutations():
    permutations = []
    for i in range(2000):
        permutations.append(Permutation())
    permutation_hash = {}
    for p1 in permutations:
        hash = str(p1.tourists)
        if hash not in permutation_hash:
            permutation_hash[hash] = 1
    print('Answer = '+ str(len(permutation_hash)))

find_permutations()
# Output: Answer = 150

```

A: You need to decide the breakup of men into 3 groups and which hotel to place them.
You could solve it rather simply using multimonials  as $\dbinom{5}{2,2,1}\dbinom {3}{2,1} + \dbinom{5}{3,1,1}\dbinom{3}{2,1}$
