I am a computer engineer and have recently started understanding quantum computers.
I am still struggling to wrap my head around some concepts.
One such query is the following - It is said that during the computation the qubits exist in the multiple states with some probability until it is measured. Once the act of measurement is done all the probabilities collapse and one answer is the output.
Now, what I am not able to get my head around is, how are we sure that this collapsed answer is the right answer? Since the superposition states are probabilistic in nature, there is a probability (though slim) of a wrong answer being output too.
Also since we cannot see or measure the intermediate superposition states we do not know which state has the highest probability. So how do we make quantum computer output the right answer?
I would highly appreciate someone to guide me through this.