Two people sit side by side on a sofa and look up the same hotel room for the same night. One sees 142. The other sees 168.

This scene is the starting point of many newspaper articles about sinister algorithms, and the true explanation is usually less dramatic and more instructive. They may have used different websites, each with its own commission arrangement. One may be logged into a loyalty scheme. The sites may be showing different room types or cancellation terms. Or the price may have changed in the thirty seconds between their searches.

Still, the suspicion behind the articles has some basis. Prices are increasingly set by software, and the software has more information than a price tag ever did. It helps to separate what is routine, what is growing and what is rare.

Prices that change with time

The oldest form is dynamic pricing, and it began with airlines.

After the American airline industry was deregulated in 1978, carriers were free to set their own fares, and they faced a particular problem. A seat on a flight is perishable: once the aircraft leaves, an empty seat is worth nothing. But the people who want that seat differ greatly. A holidaymaker books months ahead and will go elsewhere if the fare is high. A business traveller books three days before and will pay nearly anything.

The solution, developed at American Airlines in the 1980s, was called yield management. Seats on each flight are divided into fare classes at different prices. Software forecasts how many late, high-paying passengers will appear and holds back seats for them, releasing cheap seats only as far as the forecast allows. As the departure date approaches and bookings come in, the allocation is continually revised.

The effect is that the price of the same seat rises and falls with demand, and generally rises as the date nears. Hotels, car hire firms, railways and theatres adopted the method. So did ride-hailing services, which raise fares within minutes when requests outstrip available drivers.

Online retailers do the same at high speed. The largest changes prices on millions of items every day, responding to competitors, stock levels and demand. Electronic shelf labels are bringing the practice into physical supermarkets, most often to mark down food that is close to its date.

Dynamic pricing of this kind treats everyone alike at any given moment. The price depends on when you buy, and your identity does not enter into it.

Prices that change with the buyer

The second form is more contentious. Personalised pricing means charging different people different amounts for the same thing at the same moment, according to what is known about them.

Economists call this price discrimination, and it is much older than computers. Student discounts, pensioner fares and coupons are all ways of charging less to people who would not otherwise buy. What is new is the amount of information available to the seller: location, device, browsing history, past purchases.

How much personalised pricing actually takes place is debated. Documented cases exist. In 2000 a large online bookseller was found to be showing different prices for the same DVD to different customers, apologised and said it had been a test. In 2012 a newspaper reported that a travel site was showing costlier hotels first to users of Apple computers, though it was not charging them more for the same room. Investigations have found retailers varying prices by postcode.

Systematic studies have generally found less of it than people fear. Researchers who built hundreds of artificial browsing profiles and compared prices found clear evidence of personalisation on a minority of sites, and mostly in the ordering of results or in discounts for members and app users.

There are reasons for the restraint. Customers who discover they paid more than their neighbour react badly, and the reputational cost is high. In the European Union, a trader who personalises a price using automated decision-making must now say so.

What is far more common is a quieter relative: personalised offers. The listed price is the same for everyone, but who receives the discount code, the "come back" voucher or the retention offer is decided by a model.

The loyalty penalty

The most widespread and best-documented form of charging by customer type is neither new nor technically elaborate.

Insurers, energy suppliers, broadband providers and subscription services have long charged existing customers more than new ones. The practice relies on a simple prediction: a customer who did not switch last year probably will not this year. Models estimate each customer's likelihood of leaving, and prices at renewal are set accordingly.

The United Kingdom's competition authority estimated in 2018 that this cost consumers about four billion pounds a year across five markets, and that vulnerable and older customers were more likely to pay it. The financial regulator there has since banned insurers from quoting renewing customers more than new ones for home and motor cover. Elsewhere it remains widespread.

For most households this, far more than anything exotic, is where algorithmic pricing costs real money.

Pressure by design

Alongside the price itself, sites use techniques that are often automated and sometimes misleading.

"Only 2 left at this price." It may be true. It may refer to two rooms on this site at this rate, with many more available otherwise.

"14 people are looking at this now." Regulators in several countries have acted against travel sites over claims of this kind.

Countdown timers that reset when the page is reloaded.

Drip pricing, in which a low headline price gains compulsory fees as you proceed through checkout, by which time you have invested effort and are reluctant to start again.

These work on urgency and on the reluctance to lose something already half obtained.

Shopping around the system

Check more than one seller and the provider's own site. Comparison sites differ from each other, and direct prices sometimes undercut all of them.

For travel, be flexible on dates. The largest variation by far is between days and times. A fare calendar shows more than any trick with your browser.

Do not expect private browsing to change fares. The belief that airlines raise prices because you searched repeatedly is widespread. Controlled tests have mostly failed to find it. Fares change because seats sell and the forecast updates.

Look at the total. Go to the last step before payment to see the real price, with fees, before comparing.

Leave things in the basket. Retailers often send a discount to shoppers who abandon a purchase. It is not guaranteed, and it costs nothing to wait a day.

Use a price tracker for larger items. Free tools show the price history of products at major retailers. A "sale" price that was the usual price a month ago is then easy to spot.

Never auto-renew unexamined. Insurance, energy, broadband and mobile contracts are where loyalty costs most. Get a new-customer quotation every year, and ask your current provider to match it. The request usually succeeds, which tells you something about the renewal price.

Ignore the timer. If a deal is only good for the next nine minutes, it is being sold on urgency. Good offers generally survive a night's sleep.

A fair assessment

Variable pricing is not in itself a harm. Cheap advance fares exist because expensive late ones do. Surge pricing brings more drivers out when they are needed. Markdowns on food near its date reduce waste.

What has changed is the balance of information. The seller's software knows the pattern of demand, the competitors' prices and something about you. Most buyers know only the number on the screen. Narrowing that gap takes little: comparing sellers, checking the history, and refusing to be hurried.

General information, not financial advice. Consumer protection rules differ by country. Socibank is an editorial site and not a bank.