Surprise is a reaction, and reactions come from expectations.
Beliefs are decisions and that affects expectations, and therefore affect reactions, such as surprise. Computers can be programmed what to believe and how to react based on logic and guess-work in a formalized representation, and can be designed to make decisions based on that.