top of page
Inaugurated by IN-SPACe
ISRO Registered Space Tutor

S3-SA5-0126

What is Utility Functions?

Grade Level:

Class 10

AI/ML, Data Science, Physics, Economics, Cryptography, Computer Science, Engineering

Definition
What is it?

A utility function is a mathematical formula that helps us understand and measure how much 'satisfaction' or 'usefulness' someone gets from different choices or outcomes. It assigns a numerical value (a 'utility score') to each option, making it easier to compare them and pick the best one.

Simple Example
Quick Example

Imagine you have to choose between eating a plate of your favourite Biryani or a simple Dal-Roti. A utility function would assign a 'satisfaction score' to each. If Biryani gives you 100 utility points and Dal-Roti gives 70 points, the function tells you Biryani is more satisfying for you at that moment.

Worked Example
Step-by-Step

Let's say a student's 'Study Utility Function' is U(H) = 5H - H^2, where H is the number of hours studied for an exam.
---Step 1: Calculate utility for studying 1 hour (H=1).
U(1) = 5(1) - (1)^2 = 5 - 1 = 4 utility points.
---Step 2: Calculate utility for studying 2 hours (H=2).
U(2) = 5(2) - (2)^2 = 10 - 4 = 6 utility points.
---Step 3: Calculate utility for studying 3 hours (H=3).
U(3) = 5(3) - (3)^2 = 15 - 9 = 6 utility points.
---Step 4: Calculate utility for studying 4 hours (H=4).
U(4) = 5(4) - (4)^2 = 20 - 16 = 4 utility points.
---Step 5: Compare the utility scores.
The student gets the highest utility (6 points) by studying either 2 or 3 hours. Studying more or less than this reduces their perceived benefit.
Answer: The utility scores are 4, 6, 6, 4 for 1, 2, 3, 4 hours respectively. Studying 2 or 3 hours gives the maximum utility.

Why It Matters

Utility functions are crucial in fields like AI and Data Science to design systems that make optimal decisions, like recommending the best movie for you. Economists use them to understand consumer choices and market behaviour. Even game developers use them to design AI opponents that play smartly, helping create engaging games.

Common Mistakes

MISTAKE: Thinking that higher utility always means 'more' of something (e.g., more money, more hours). | CORRECTION: Utility measures satisfaction, which can decrease after a certain point. For example, too much food can give negative utility.

MISTAKE: Believing everyone has the same utility function for the same things. | CORRECTION: Utility functions are personal and depend on individual preferences. What gives high utility to one person might give low utility to another (e.g., someone loving spicy food vs. someone who doesn't).

MISTAKE: Confusing utility with monetary value. | CORRECTION: While money can influence utility, utility measures satisfaction, not just price. A free item that brings great joy can have higher utility than an expensive one that brings little joy.

Practice Questions
Try It Yourself

QUESTION: If a utility function for watching movies is U(M) = 10M - M^2, where M is the number of movies watched. What is the utility of watching 3 movies? | ANSWER: U(3) = 10(3) - (3)^2 = 30 - 9 = 21 utility points.

QUESTION: For the movie utility function U(M) = 10M - M^2, what number of movies (M) gives the maximum utility? (Try M=1, 2, 3, 4, 5, 6) | ANSWER: M=5 gives maximum utility. U(5) = 10(5) - (5)^2 = 50 - 25 = 25. For M=4, U(4)=24; for M=6, U(6)=24.

QUESTION: A mobile game player's 'fun utility' from playing a game for 'T' hours is given by U(T) = 20T - 2T^2. If they play for 2 hours, then for how many more hours should they play to reach the maximum possible fun utility? | ANSWER: First, find max utility. U(T) = 20T - 2T^2. Try T=1,2,3,4,5,6,7,8,9,10. U(5) = 20(5) - 2(5)^2 = 100 - 50 = 50 (max utility). Utility at 2 hours = 20(2) - 2(2)^2 = 40 - 8 = 32. To reach max utility, they should play for 5 hours in total. So, they need to play for 5 - 2 = 3 more hours.

MCQ
Quick Quiz

Which of the following best describes what a utility function measures?

The monetary cost of a product

The physical weight of an object

The satisfaction or usefulness derived from a choice

The speed at which something operates

The Correct Answer Is:

C

A utility function is designed to quantify the satisfaction or usefulness a person gets from different options or outcomes. It's not about cost, weight, or speed.

Real World Connection
In the Real World

When you use a food delivery app like Swiggy or Zomato, the app's recommendation engine uses principles similar to utility functions. It tries to predict what food you'll find most satisfying based on your past orders, ratings, and preferences, effectively assigning a 'utility score' to each restaurant or dish to show you the best options.

Key Vocabulary
Key Terms

UTILITY: The satisfaction or usefulness gained from something | OPTIMIZATION: Finding the best possible solution or choice | PREFERENCE: A stronger liking for one option over another | DECISION-MAKING: The process of choosing between different options

What's Next
What to Learn Next

Now that you understand utility functions, you can explore 'Optimization Problems'. This next concept will teach you how to use utility functions and other mathematical tools to find the absolute best choices in various real-world situations, which is super useful for building smart systems!

bottom of page