Crypto smart contracts: If the execution has an objective but undefinable variable, how is the result validated?

I understand how a smart contract might work for a variable with a binary value. For example, a purchase may occur if the price on a certain exchange hits an agreed upon value or the winner of a bet could collect if Team A beats Team B as reported by an agreed upon source. However, what if the execution is dependent on a variable that can’t be explicitly predefined?

For example, say I wanted to create a smart contract betting pool for what name Britney Spears will give her child. Participants can secure their guesses, and the person who chooses correctly would win the prize money. The variable that needs to be input to execute the contract has a single answer, but how would the contract independently determine what it is?

My understanding is that “smart” contracts like this aren’t actually smart in the way you’re thinking. The contract itself can’t actually interact with reality, it either relies on a third party who controls some input to the contract directly (pay out when the trusted oracle sends the payout message with the correct key) or relies on a third party that controls some readable state (pay out when the trusted oracle updates the value at some previously agreed on URI).

If it’s the latter you program the contract to pay out to everyone who put the same character string in for their guess as shows up on the trusted 3rd party webpage.