I just started to study blockchain and bitcoin yesterday and came up with some questions.
If miners can select transactions when creating a block, how is it ensured that all the transactions over every 10 minutes are recorded? For example, if a miner selected only a half of all the transactions over 10 minutes and found a valid hash, how can the other half of the transactions be recorded?
The answer to the first question might render this question unnecessary, but if miners can select transactions when creating a block, how is it ensured that the first one didn't include any invalid transactions over the 10 minutes?
Also, why is only the first one to find a valid hash rewarded while the first one might have left out some transactions during selection (although an answer to Q1 might render this worry unnecessary)? Is there any security reason behind choosing the first one? For example, is the first one considered to be the most trustworthy because it takes time to make invalid modifications on previous/current transactions?
The fourth question came out while I was watching 19:43~ of the following video: https://www.youtube.com/watch?v=bBC-nXj3Ng4. It is understandable that Alice will fail to cheat because Alice can't create invalid blocks faster than the rest of the miners. However, what if Alice broadcasted the first invalid block to every other miner? In that case, wouldn't all the other miners find next blocks based on the assumption that Alice's first invalid block is valid so that Alice wouldn't have to exceed all the other miners every time?