Friday, October 3, 2025
HomeLanguagesPython | Percentage increase in hemisphere volume if radius is increased

Python | Percentage increase in hemisphere volume if radius is increased

Given that the radius of a hemisphere is increased by a fixed percentage so, the target is to calculate the percentage increase in the volume of the hemisphere.
 

Examples: 
Input : 
20 
Output : 
72.8 %
Input : 
70 
Output : 
391.3 % 
 

Approach: 
Let, the radius of the hemisphere = a
Given percentage increase = x%
Volume before increase = \frac{2}{3} * 3.14*a^3
New radius after increase = a + \frac{ax}{100}
So, new volume = \frac{2}{3}*3.14*(a^3 + (\frac{ax}{100})^3 + \frac{3a^3x}{100} + \frac{3a^3x^2}{10000})
Change in volume = \frac{2}{3}*3.14*((\frac{ax}{100})^3 + \frac{3a^3x}{100} + \frac{3a^3x^2}{10000})
Percentage increase in volume = (\frac{2}{3}*3.14*((\frac{ax}{100})^3 + \frac{3a^3x}{100} + \frac{3a^3x^2}{10000})/\frac{2}{3}*3.14*a^3) * 100 = \frac{x^3}{10000} + 3x + \frac{3x^2}{100}
Below is the Python code implementation of the above mentioned approach. 
 

Python3




# Python3 program to find percentage increase
# in the volume of the hemisphere
# if the radius is increased by a given percentage
   
def newvol(x):
   
    print('percentage increase in the  volume of the hemisphere is ', pow(x, 3) / 10000 + 3 * x
                + (3 * pow(x, 2)) / 100, '%')
   
# Driver code
x = 10.0
newvol(x)


Output : 

percentage increase in the volume of the hemisphere is  33.1 %

Time Complexity: O(log x) because pow function would take logarithmic time

Auxiliary Space: O(1)

 

Feeling lost in the world of random DSA topics, wasting time without progress? It’s time for a change! Join our DSA course, where we’ll guide you on an exciting journey to master DSA efficiently and on schedule.
You’ll access excellent video content by our CEO, Sandeep Jain, tackle common interview questions, and engage in real-time coding contests covering various DSA topics. We’re here to prepare you thoroughly for online assessments and interviews.
Ready to dive in? Explore our free demo content and join our DSA course, trusted by over 100,000neveropen! Whether it’s DSA in C++, Java, Python, or JavaScript we’ve got you covered. Let’s embark on this exciting journey together!
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32331 POSTS0 COMMENTS
Milvus
85 POSTS0 COMMENTS
Nango Kala
6703 POSTS0 COMMENTS
Nicole Veronica
11868 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11929 POSTS0 COMMENTS
Shaida Kate Naidoo
6818 POSTS0 COMMENTS
Ted Musemwa
7080 POSTS0 COMMENTS
Thapelo Manthata
6775 POSTS0 COMMENTS
Umr Jansen
6776 POSTS0 COMMENTS