Artificial intelligence
Assignment
NAME: HEMANTH NAYAKA
CLASS : CSE ‘B’
USN : CSEB’14
DATE : 23/12/2025
Activity on Creating Effective
Prompts
[Link] the topic "Electricity." The first prompt should be vague,
and the second prompt should be clear and specific. Compare
the responses you get and describe which prompt gave a better
answer and why
ANS:- Vague Prompt
Prompt:
Tell me about electricity.
Typical AI Response (Example):
Electricity is a form of energy caused by the movement of electric charges, usually electrons.
It is used in homes, industries, and technology to power devices, lights, and machines.
Electricity can be generated from sources like coal, water, wind, and solar energy.
Observation:
• Very general
• Covers many things briefly
• No depth or focus
• Not tailored to any specific need
Clear and Specific Prompt
Prompt:
Explain what electricity is for a high-school student. Include the definition, how electricity is
generated, the difference between AC and DC, and one real-life example. Limit the answer to
200 words.
Typical AI Response (Example):
Electricity is a form of energy that comes from the movement of electrons through a
conductor like a wire. It is generated in power plants using sources such as coal, water
(hydropower), wind, or solar energy.
There are two main types of electricity: AC (Alternating Current) and DC (Direct
Current). AC changes direction periodically and is used in homes because it can travel long
distances efficiently. DC flows in only one direction and is used in batteries and electronic
devices.
A real-life example of electricity is switching on a fan at home. When you press the switch,
electricity flows through the circuit and powers the motor, making the fan rotate.
Observation:
• Well-structured
• Level-appropriate
• Covers exactly what was asked
• Clear and useful
•
1. Zero-Shot Prompting: Create a prompt that asks an AI to
explain Ohm’s Law without giving any example or
background. Evaluate how well the AI explains the concept
based on your prompt alone.
ANS:- Zero-Shot Prompt (No examples or background)
Prompt:
Explain Ohm’s Law.
AI Response (Example)
Ohm’s Law states that the current flowing through a conductor is directly proportional to the
voltage applied across it, provided that the temperature and other physical conditions remain
constant. It is mathematically expressed as V = IR, where V represents voltage, I represents
current, and R represents resistance. This law describes the fundamental relationship between
these three electrical quantities and is widely used in the analysis and design of electrical and
electronic circuits.
Evaluation of the Zero-Shot Response
Strengths
• Correctly defines Ohm’s Law
• Includes the standard formula (V = IR)
• Uses clear and precise terminology
• No need for prior context or examples
Limitations
• Lacks intuitive explanation
• No real-world connection
• May be slightly abstract for beginners
Overall Assessment
The AI explains Ohm’s Law accurately and concisely, even without any examples or
background information. This shows that zero-shot prompting is effective for well-known
concepts like Ohm’s Law. However, while the explanation is technically correct, it could be
improved for learning purposes by adding examples or analogies—something not allowed in
zero-shot prompting.
3. One-Shot and Few-Shot Prompting: Provide the AI with a single
example of how to calculate the resistance in a simple circuit.
Then write your own prompt asking the AI to solve a similar
resistance calculation. After that, add two more examples to your
prompt and observe any changes in the AI’s response quality.
ANS:- One-Shot and Few-Shot Prompting (Electricity – Resistance
Calculation)
Step 1: One-Shot Prompting (Single Example Given)
Example Provided to the AI
Example:
If the voltage (V) in a circuit is 10 V and the current (I) is 2 A, the resistance (R) is calculated
using Ohm’s Law:
R = V / I = 10 / 2 = 5 Ω
Your One-Shot Prompt
AI Response (Typical)
Using Ohm’s Law, R = V / I.
R = 12 / 3 = 4 Ω
Observation
Step 2: Few-Shot Prompting (Three Examples Given)
Examples Provided to the AI
Example 1:
V = 10 V, I = 2 A → R = 10 / 2 = 5 Ω
Example 2:
V = 20 V, I = 4 A → R = 20 / 4 = 5 Ω
Example 3:
V = 9 V, I = 3 A → R = 9 / 3 = 3 Ω
Your Few-Shot Prompt
AI Response (Typical)
Observation
• Clear step-by-step solution
• Better structure
• More confidence and consistency
• Matches the pattern of previous examples
Comparison of Response Quality
Prompt Type Explanation Quality Structure Clarity
One-Shot Medium Basic Good
Few-Shot High Well-organized Very Clear
4. Chain-of-Thought Prompting: Develop a prompt that guides the
AI step-by-step through calculating current flow in a circuit using
Ohm’s Law with resistors in series. Then, ask a final question for
the AI to solve. Analyze how breaking down the reasoning steps
impacts the accuracy of the answer.
ANS:-Chain-of-Thought Prompting (Ohm’s Law – Series Circuit)
Step 1: Chain-of-Thought Prompt (Guided, Step-by-
Step)
Prompt given to the AI:
You are given a simple electric circuit with resistors connected in series.
Follow these steps carefully:
1. Identify the values of all resistors in the circuit.
2. Calculate the total resistance by adding all series resistances.
3. Identify the supply voltage of the circuit.
𝑉
4. Apply Ohm’s Law to calculate the total current using the formula 𝐼 = 𝑅.
5. Clearly show each step and the final answer with units.
Final Question:
A circuit has three resistors in series: 2 Ω, 3 Ω, and 5 Ω. The supply voltage is 20 V.
Calculate the current flowing through the circuit.
Step 2: AI Response (With Chain-of-Thought)
Step 1: The resistors given are 2 Ω, 3 Ω, and 5 Ω.
Step 2: For series circuits, total resistance is the sum of all resistances:
R = 2 + 3 + 5 = 10 Ω
Step 3: The supply voltage is V = 20 V.
Step 4: Using Ohm’s Law,
I = V / R = 20 / 10
Step 5:
I=2A
Final Answer: The current flowing through the circuit is 2 amperes (A).
Analysis: Impact of Chain-of-Thought Prompting
Improvements Observed
• Logical step-by-step reasoning
• No missing calculations
• Clear use of formulas
• Lower chance of conceptual mistakes
• Easy to verify the answer
Without Chain-of-Thought (Typical Risk)
If the prompt were simply:
Calculate the current in a series circuit with given values.
The AI might:
• Skip steps
• Make arithmetic errors
• Provide only the final answer without explanation
Comparison
Aspect Without Steps With Chain-of-Thought
Accuracy Medium High
Transparency Low Very High
Learning Value Low Excellent
Exam Suitability Average Ideal
5. Prompt Refinement: Start with an ambiguous prompt related to
the "Water Cycle." Test the AI’s response, note the confusion or
errors, and then refine your prompt to make it clearer and more
specific. Repeat this process twice and record how the AI’s
responses improve with each refinement.
Role-Based Prompting: Create three prompts asking the AI to
explain "Newton’s Laws of Motion," each with a different role
instruction: (a) as an expert engineer, (b) as a high school teacher,
(c) as a beginner. Compare the tone, detail, and style of the
responses
ANS :-Prompt Refinement & Role-Based Prompting
) PART A: Prompt Refinement (Topic: Water Cycle
Iteration 1: Ambiguous Prompt
Prompt 1 (Ambiguous):
Explain the water cycle.
AI Response (Typical):
The water cycle is the continuous movement of water on Earth. It includes processes like
evaporation, condensation, and precipitation.
Problems Observed
• Very brief
• No explanation of stages
• No structure
• Unclear target audience
Iteration 2: First Refinement
Prompt 2 (More Specific):
Explain the water cycle and describe its main stages.
AI Response (Improved):
The water cycle describes how water moves through Earth’s atmosphere and surface. The
main stages include evaporation, where water turns into vapor; condensation, where vapor
forms clouds; and precipitation, where water falls as rain, snow, or hail.
Improvements
• Key stages included
• Better clarity
• Still lacks depth and learning focus
Remaining Issues
• No order or flow
• No student-level guidance
Iteration 3: Second Refinement (Clear & Specific)
Prompt 3 (Highly Refined):
Explain the water cycle for a middle-school student. Describe each stage in order
(evaporation, condensation, precipitation, and collection) with simple language. Limit the
answer to 150 words.
AI Response (Best Quality):
The water cycle is the continuous process by which water moves around the Earth. First,
evaporation occurs when heat from the Sun causes water in rivers, lakes, and oceans to turn
into water vapor. Next, during condensation, the water vapor cools and forms clouds. Then,
precipitation happens when water falls back to Earth as rain, snow, or hail. Finally,
collection occurs when water gathers in rivers, lakes, and oceans, starting the cycle again.
Major Improvements
• Well-structured
• Age-appropriate
• Clear sequence
• Educational and complete
Summary: Prompt Refinement Impact
Version Clarity Detail Learning Value
Ambiguous Low Very Low Poor
First Refinement Medium Medium Average
Second Refinement High High Excellent
Conclusion (Prompt Refinement)
Each refinement reduces ambiguity and increases accuracy, clarity, and usefulness of the AI’s
response.
PART B: Role-Based Prompting (Newton’s Laws of
Motion)
(a) Role: Expert Engineer
Prompt:
Explain Newton’s Laws of Motion as an expert engineer.
AI Response Style (Observed):
• Formal tone
• Technical language
• Focus on applications (forces, systems, design)
• Less storytelling, more precision
Example Tone:
Newton’s Laws form the foundation of classical mechanics and are essential for analyzing
forces in mechanical systems, structural design, and motion control.
(b) Role: High School Teacher
Prompt:
Explain Newton’s Laws of Motion as a high school physics teacher.
AI Response Style (Observed):
• Clear and structured
• Simple definitions
• Examples related to daily life
• Exam-oriented explanation
Example Tone:
Newton’s First Law explains why passengers move forward when a bus suddenly stops.
(c) Role: Beginner
Prompt:
Explain Newton’s Laws of Motion as if I am a complete beginner.
AI Response Style (Observed):
• Very simple language
• Friendly tone
• Minimal technical terms
• Focus on intuition
Example Tone:
Objects keep doing what they are doing unless something pushes or pulls them.
Comparison: Role-Based Prompting
Role Tone Detail Level Style
Expert Engineer Professional High Technical
High School Teacher Instructional Medium Structured & clear
Beginner Friendly Low Simple & intuitive
Final Conclusion
Role-based prompting changes the AI’s tone, depth, and explanation style without
changing the core concept.
Key Takeaways:
• Prompt Refinement improves accuracy and usefulness
• Role Instructions adapt explanations to the audience
• Best results come from clear + role-based prompt.
[Link] Engineering Problem Prompts: Craft a prompt that asks
the AI to brainstorm ideas for designing a low-cost water
purification system suitable for rural areas. Encourage creativity
by adding phrases like “limited resources” and “sustainability”.
ANS:-Creative Engineering Problem Prompts
Below is a well-crafted creative prompt designed to encourage innovative, practical, and
sustainable thinking from an AI.
Creative Engineering Prompt
Prompt:
Act as a creative and socially responsible engineer. Brainstorm innovative ideas for
designing a low-cost water purification system suitable for rural areas. Assume there are
limited resources, minimal access to electricity, and a need for sustainability. Focus on
locally available materials, ease of maintenance, environmental impact, and affordability.
Provide multiple design concepts and briefly explain how each one works.
Expected AI Response Quality (What This Prompt
Encourages)
Using phrases like “limited resources” and “sustainability”, the AI is guided to:
• Think beyond expensive, high-tech solutions
• Propose grassroots-level innovations
• Consider real-world constraints
• Balance engineering + social impact
Example Ideas the AI Might Generate:
• Solar-based water purification
• Sand–charcoal–gravel filtration units
• Low-cost ceramic filters
• Gravity-driven purification systems
• Natural disinfectants (solar UV, plant-based methods)
Why This Prompt Works Well
Prompt Element Impact
Creative engineer role Encourages innovation
Low-cost Avoids impractical designs
Rural areas Adds real-world context
Limited resources Forces constraint-based thinking
Sustainability Promotes eco-friendly solutions
Multiple ideas requested Increases creativity.
[Link] Prompt Design Discussion: Identify a biased prompt
related to job descriptions (e.g. language with respect to a
gender). Rewrite the prompt to remove bias and create a neutral,
inclusive version. Explain why this revision is more ethical.
ANS:-Ethical Prompt Design Discussion (Bias in Job Descriptions)
Step 1: Identify a Biased Prompt
Biased Prompt (Gender Bias):
We are looking for a strong, aggressive salesman who can dominate clients and work long
hours without family distractions.
Problems with This Prompt
• Uses gendered language (“salesman”)
• Promotes stereotypes (“aggressive,” “dominate”)
• Implies exclusion of people with family responsibilities
• Discourages women and non-binary candidates
• Creates an unfair and discriminatory tone
Step 2: Rewrite the Prompt (Bias-Free & Inclusive)
Revised Ethical Prompt (Neutral & Inclusive):
We are looking for a motivated sales professional who can build strong client relationships,
communicate effectively, and manage responsibilities efficiently. The role values
professionalism, collaboration, and work–life balance.
Step 3: Why the Revised Prompt Is More Ethical
Ethical Improvements Explained
Aspect Biased Prompt Inclusive Prompt
Language Gender-specific Gender-neutral
Tone Aggressive, exclusionary Professional, respectful
Accessibility Discouraging Welcoming
Fairness Discriminatory Equal opportunity
Ethics Poor Strong
Key Reasons:
• Removes gender bias by using neutral terms (“sales professional”)
• Focuses on skills, not personality stereotypes
• Respects diversity in personal lives and backgrounds
• Encourages equal opportunity employment
• Aligns with ethical AI and HR practices
Final Conclusion
Ethical prompt design ensures fairness, inclusivity, and respect.
By removing biased language, we make prompts—and AI outputs—more accurate, humane,
and socially responsible.
8. Simulated Customer Support Chatbot: Develop a prompt that
instructs the AI to play the role of a technical support agent
helping a customer troubleshoot a failure in an electronic circuit.
Include instructions to keep the tone friendly and professional
and to ask diagnostic questions.
ANS:-Simulated Customer Support Chatbot (Prompt Design)
Below is a well-structured prompt that clearly instructs the AI to act as a technical support
agent, maintain a friendly and professional tone, and ask diagnostic questions while
troubleshooting an electronic circuit failure.
Customer Support Simulation Prompt
Prompt:
*You are a friendly, patient, and professional technical support agent specializing in basic
electronics. Your task is to help a customer troubleshoot a failure in an electronic circuit.
Begin by politely acknowledging the issue. Ask clear and relevant diagnostic questions to
understand the problem (such as power supply status, component values, connections, and
symptoms).
Guide the customer step by step through basic troubleshooting checks, explain concepts in
simple language, and avoid technical jargon unless necessary.
Keep your tone supportive and respectful throughout the conversation. If the issue cannot be
resolved immediately, suggest safe next steps or recommend professional inspection. Do not
blame the user.*
Why This Prompt Is Effective
Prompt Instruction Benefit
Role defined (technical support agent) Sets correct behavior and expertise
Friendly & professional tone Improves user experience
Diagnostic questions required Encourages systematic troubleshooting
Step-by-step guidance Reduces confusion
Simple language Accessible to non-experts
Prompt Instruction Benefit
No blaming Builds trust
Example Diagnostic Questions the AI Will Ask
• Is the power supply turned on and delivering the correct voltage?
• Are any components overheating or visibly damaged?
• Is the circuit working intermittently or not at all?
• Have there been any recent changes to the circuit?
• Are all connections secure and correctly placed?.
9. Multi-Language Prompting: Develop a prompt that asks the AI
to translate a simple engineering glossary (5 technical terms)
from English to your native language. Then modify the prompt to
request additional explanations of these terms in the translated
language.
ANS:-Prompt 1: Translation Only (Engineering Glossary)
Prompt:
Translate the following simple engineering glossary from English to
Kannada. Provide only the Kannada translations.
1. Voltage
2. Current
3. Resistance
4. Power
5. Circuit
Prompt 2: Translation + Explanation (Enhanced Prompt)
Prompt:
Translate the following simple engineering glossary from English to
Kannada. After each translated term, give a short and easy
explanation in Kannada suitable for a beginner engineering student.
1. Voltage – ವೋಲ್ಟ ೋಜ್ (ವಿದ್ಯು ತ್ ಒತ್ತ ಡ)
2. Current – ವಿದ್ಯು ತ್ ಪ್ರ ವಾಹ
[Link] – ಪ್ರ ತಿರೋಧ
4. Power – ವಿದ್ಯು ತ್ ಶಕ್ತತ
5. Circuit – ವಿದ್ಯು ತ್ ವಲಯ
10. Review a curated set of different prompt types (e.g., for
summarization, information extraction, paraphrasing, question
answering) from a “Prompt Gallery.” For each prompt type, match
it with a real-world task (e.g., summarizing a lecture note,
extracting names from a project report). Test at least three prompt
templates on an AI tool or by role-play (students simulate being
the AI), with varied wording. Record the outcomes and discuss
which prompt (or template) was most effective for each task, and
explain why you think it worked best. Reflect on how changing
small parts of a prompt can alter model response quality,
completeness, or accuracy.
ANS:-Review of Prompt Types from a Prompt Gallery
Introduction
A Prompt Gallery contains example prompts designed for
different Natural Language Processing (NLP) tasks such as
summarization, information extraction, paraphrasing, and
question answering. In this activity, different prompt types are
reviewed, matched with real-world tasks, tested using varied
prompt templates (by AI tool or student role-play), and
evaluated based on effectiveness. The impact of small prompt
changes on output quality is also analyzed.
Prompt Types and Real-World Task Mapping
Prompt Type Real-World Task
Summarizing lecture notes for exam
Summarization
revision
Information Extracting names and dates from a
Extraction project report
Paraphrasing Rewriting content to avoid plagiarism
Question Answering Answering questions from study material
Testing Prompt Templates (Role-Play as AI)
Task 1: Summarization
Source Text:
A 2-page lecture note on Ohm’s Law and basic electrical
concepts.
Prompt Template A
Summarize the following lecture notes.
Outcome:
• Output was very short
• Important formulas were missing
Prompt Template B
Summarize the following lecture notes in 5 bullet points for
exam revision.
Outcome:
• Clear structure
• Key formulas included
• Easy to revise
Prompt Template C
Summarize the following lecture notes for a first-year
engineering student using simple language.
Outcome:
• Very clear explanation
• Slightly longer than needed for revision
Most Effective Prompt: Template B
Reason: It specified format (bullet points) and purpose (exam
revision), leading to concise and relevant output.
Task 2: Information Extraction
Source Text:
A project report containing team members, guide name, and
submission date.
Prompt Template A
Extract important information from the report.
Outcome:
• Too vague
• Mixed important and unimportant details
Prompt Template B
Extract only the names of team members and the project guide
from the report.
Outcome:
• Accurate
• Clean list of names
Prompt Template C
List the team members, guide name, and submission date in a
table.
Outcome:
• Well-structured
• Very clear
• Easy to reuse
Most Effective Prompt: Template C
Reason: Explicitly mentioned what to extract and output
format, improving clarity and usability.
Task 3: Paraphrasing
Source Text:
A paragraph explaining climate change causes.
Prompt Template A
Paraphrase the following text.
Outcome:
• Minor word changes
• Risk of plagiarism
Prompt Template B
Paraphrase the following text using simple words without
changing the meaning.
Outcome:
• Clear
• Meaning preserved
Prompt Template C
Rewrite the following paragraph in your own words for an
academic assignment, avoiding plagiarism.
Outcome:
• Strong rewording
• Academic tone
• Very safe for submission
Most Effective Prompt: Template C
Reason: Included context (academic assignment) and
constraint (avoid plagiarism).
Reflection: Effect of Small Prompt Changes
Small changes in prompt wording significantly affect the
model’s response:
Prompt Change Effect on Output
Adding audience (e.g., “first-year Improves clarity and
student”) tone
Specifying format (bullet points, table) Improves organization
Adding purpose (exam, assignment) Improves relevance
Prompt Change Effect on Output
Adding constraints (simple language, Improves accuracy and
avoid plagiarism) safety
Key Observations
• Vague prompts → generic answers
• Structured prompts → focused and accurate answers
• Purpose-driven prompts → higher quality responses.
11. Choose a real engineering challenge or societal problem
relevant to your field (e.g., “Reducing plastic waste in campus
cafeterias” or “Optimizing solar panel placement on campus
rooftops”). Draft an initial prompt that asks an AI to propose
practical solutions. Share the AI’s (or peer’s) answer in small
groups and identify aspects that are missing, vague, or not
actionable. Refine your prompt based on feedback (e.g., specify
constraints, ask for step-by-step solutions, or require a list of pros
and cons). Repeat the process one more time, refining again for
further clarity or specificity. Document the entire prompt-
refinement process and share the best solution generated, along
with a brief analysis of how prompt improvements led to better
responses.
ANS:-Prompt Refinement for Solving a Real Engineering / Societal
Problem
Chosen Problem
Step 1: Initial Prompt (Version 1 – Broad Prompt)
Prompt V1
Propose solutions to reduce plastic waste in campus cafeterias.
AI / Peer Response (Summary)
• Encourage students to avoid plastic
• Use eco-friendly materials
• Create awareness programs
Issues Identified (Group Discussion Feedback)
• Solutions are too generic
• No implementation details
• No mention of cost, feasibility, or responsibility
• Not actionable for campus administration
Step 2: Refined Prompt (Version 2 – With Constraints &
Structure)
Prompt V2
Propose practical solutions to reduce plastic waste in campus cafeterias.
Consider cost, ease of implementation, and student participation.
Provide at least 5 solutions with brief explanations.
AI / Peer Response (Summary)
1. Replace plastic cups with steel or paper cups
2. Introduce reusable plates and cutlery
3. Offer discounts for students bringing their own bottles
4. Install water refill stations
5. Conduct awareness campaigns
Improvements Observed
• More specific solutions
• Some consideration of cost and participation
• Still missing:
o Step-by-step execution
o Responsibility (who will do what?)
o Advantages and disadvantages
Step 3: Further Refined Prompt (Version 3 – Actionable
& Detailed)
Prompt V3 (Final Prompt)
*Design a step-by-step action plan to reduce plastic waste in campus cafeterias.
Constraints:
• Low budget
• Implementation within 6 months
• Suitable for Indian engineering colleges
For each solution, include:
1. Description
2. Implementation steps
3. Pros and cons
4. Estimated cost level (low/medium)
5. Responsible stakeholders (students, administration, vendors)*
Best AI-Generated Solution (From Final Prompt)
Solution 1: Reusable Steel Plates and Tumblers
• Steps: Replace disposable items → train cafeteria staff → maintain washing stations
• Pros: Long-term cost saving, eco-friendly
• Cons: Initial setup cost
• Cost: Medium
• Stakeholders: Administration, vendors
Solution 2: Bring-Your-Own-Bottle Incentive
• Steps: Discount system → awareness posters → vendor cooperation
• Pros: High student participation, low cost
• Cons: Requires monitoring
• Cost: Low
• Stakeholders: Students, vendors
Solution 3: Water Refill Stations
• Steps: Install RO units → regular maintenance
• Pros: Reduces bottled water usage
• Cons: Maintenance required
• Cost: Medium
• Stakeholders: Administration
Solution 4: Vendor Plastic Usage Policy
• Steps: Contract rules → penalties for violations
• Pros: Enforced reduction
• Cons: Vendor resistance initially
• Cost: Low
• Stakeholders: Administration
Solution 5: Student Green Committee
• Steps: Form committee → monthly audits → reporting
• Pros: Student ownership, sustainability
• Cons: Needs motivation
• Cost: Low
• Stakeholders: Students
Analysis: How Prompt Refinement Improved Results
Prompt Version Quality of Output
Version 1 Generic, vague ideas
Version 2 Clearer but incomplete
Version 3 Actionable, structured, realistic
Key Learnings
• Adding constraints improves realism
• Asking for step-by-step plans improves actionability
• Requiring pros and cons improves decision-making
• Defining stakeholders improves responsibility clarity.