Miss X is a shopaholic person and every weekend she goes to a mall. There are total of 10 shops. Miss X starts from shop #1 and goes till last shop. Looking at her pattern of shopping from previous week, a shopkeeper wants to predict the probability of her shopping from his shop this weekend. Can you help the shopkeeper?
Also, find the average amount that she spent in last week. Round the answer to 2 digits after decimal.
Example
item_price = [10 35 2 100 99 87 1 0.5 9 30]
total_items_shopped = [ 2 0 5 10 8 9 1 0 0 1]
Average spending = $73.22
Probability of shopping from shop# 5 is:0.22
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers28
Suggested Problems
-
252 Solvers
-
Getting the absolute index from a matrix
259 Solvers
-
Sum the entries of each column of a matrix which satisfy a logical condition.
176 Solvers
-
Split a string into chunks of specified length
2140 Solvers
-
Create the following sequence : 0 1 1 4 9 25 64 169 ...
206 Solvers
More from this Author25
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!