Problem 44763. Pumpkin Pie!
It's time for desert at Thanksgiving. You've all gathered at grandma's house, and she's about to start cutting the pumpkin pie. You notice, though, that the same particular routine is always followed:
- each guest tells her what fraction of the remaining pie they want
- there are an arbitrary number of relatives present each year
- you are next to last, since you always sit next to grandpa
- grandpa is last, and will eat whatever is left
> however, he should only eat up to 1/8 of the total pie, due to health problems
> but, if you don't leave him 1/8 of the pie, you probably won't get a good Christmas presentSo, you must calculate the fraction of what remains to eat such that 1/8 of the whole pie is left for grandpa. If whatever remains is less than or equal to 1/8, you can 'pass', and grandpa won't hold a grudge.
You must give grandma a fraction (in character format), though. She despises decimals, but loves to simplify fractions, so just ensure that the fraction you provide is close enough to the decimal value.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers19
Suggested Problems
-
Find the numeric mean of the prime numbers in a matrix.
9120 Solvers
-
Remove the small words from a list of words.
1557 Solvers
-
Removing rows from a matrix is easy - but what about inserting rows?
260 Solvers
-
Replace all zeros and NaNs in a matrix with the string 'error'
103 Solvers
-
728 Solvers
More from this Author139
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!