Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2025-04-11 12:45:21

RegJose
Novice
Registered: 2025-04-10
Posts: 8

Sending a box containing several varieties of seeds with a total unit

A company sends its customers a box that is always the same size and contains seed samples from various plant varieties, and those seeds are all of a similar size. There may be some extra space in the box, but it's not relevant.

For example, the customer may request seeds from chickpea, lentil, and bean varieties.

The seller checks his stock and realizes he has the following quantities available:

Chickpeas -> [Variety1 = 30, Variety2 = 0,   Variety3 = 100, Variety4 = 50, Variety5 = 30]  Total: 210 Importance = 100
Lentils      -> [Variety1 = 20, Variety2 = 40, Variety3 = 90,   Variety4 = 10, Variety5 = 0]    Total: 160 Importance = 80
Beans       -> [Variety1 = 1,   Variety2 = 5,   Variety3 = 20,  Variety4 = 0,   Variety5 = 500] Total: 526 Importance = 60

The total sum is 896, but the box he will send to the customer only holds 200.

So the seller seeks to reduce the highest values of each seed variety proportionally (No. equalizing) but trying not to remove seeds with low values. This way, the customer can plant the maximum possible number of seeds of the same type that fit in their box. That is, if the highest values for a seed type are 100 and 80, they would be reduced to 90 and 72.

In addition, the customer assigns each seed variety a variable called "Importance" from 0 to 100, so they can request fewer "Lentil" seeds to be sent to benefit from having more "Chickpea" seeds. If "Importance = 0," it means they don't want that type of seed sent to them. If the customer indicates "Importance = 60" for Lentils, it means they only want 60% of that type of seed, but always trying to reduce the highest numbers and keep the lowest.

Example with a single seed type:
Seller has                   -> [30, 0, 100, 90, 30] = 250
Sends to the customer -> [30, 0, 70, 70, 30]  = 200

----------------

Offline

#2 2025-04-12 00:27:51

ktesla39
Member
From: Nepal
Registered: 2024-10-08
Posts: 261
Website

Re: Sending a box containing several varieties of seeds with a total unit

Hi,

Will this work:

A = [5, 0, 20, 10, 5] sum = 40
B = [10, 20, 25, 5, 0] sum = 60
C = [1, 2, 7, 0, 90] sum = 100
Total sum = 200

Is that right? smile


"Talent hits the target no one else can hit. Genius hits the target no one else can see." - Arthur Schopenhauer

Offline

#3 2025-04-12 14:29:29

RegJose
Novice
Registered: 2025-04-10
Posts: 8

Re: Sending a box containing several varieties of seeds with a total unit

I would like someone to make a C function

Offline

#4 2025-04-12 14:43:44

ktesla39
Member
From: Nepal
Registered: 2024-10-08
Posts: 261
Website

Re: Sending a box containing several varieties of seeds with a total unit

C function? What's that?


"Talent hits the target no one else can hit. Genius hits the target no one else can see." - Arthur Schopenhauer

Offline

#5 2025-04-12 19:37:32

Bob
Administrator
Registered: 2010-06-20
Posts: 10,740

Re: Sending a box containing several varieties of seeds with a total unit

A C function is a computer program routine written in the language C.

This scenario is clearly artificial as no business person would, given the choice, send out all of the product that is in low supply whilst restricting amounts of the product in plentiful supply.  That's a topsy turvy law of supply and demand. I conclude this is a homework assignment.

On this forum we don't do people's homework.  If,  RegJose, you have most of the code written, but are stuck over one issue, post what you've done and perhaps someone will be able to help with that.

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#6 2025-04-12 19:53:04

ktesla39
Member
From: Nepal
Registered: 2024-10-08
Posts: 261
Website

Re: Sending a box containing several varieties of seeds with a total unit

Is this related to the subject Economics?


"Talent hits the target no one else can hit. Genius hits the target no one else can see." - Arthur Schopenhauer

Offline

#7 2025-04-12 20:43:48

Bob
Administrator
Registered: 2010-06-20
Posts: 10,740

Re: Sending a box containing several varieties of seeds with a total unit

I very much doubt it as this isn't a way that economists work.  If you're in business and you've got two products to sell, one (A) in plentiful supply and the other (B) in only small quantities, you create a business model where you try to sell lots of A in preference to B.  In this post the opposite is applied ie keep supply of A down but maintain B as much as possible.  An economics course would only have that as a question if the teachers wanted to ask "What is wrong with this model?"

It looks like an exercise that might occur in a C language course. In my experience programmers usually know nothing about the real world. I might be wrong of course smile .

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#8 2025-04-12 23:02:59

ktesla39
Member
From: Nepal
Registered: 2024-10-08
Posts: 261
Website

Re: Sending a box containing several varieties of seeds with a total unit

I could make a model in C but here the problem isn't any logical, is it?


"Talent hits the target no one else can hit. Genius hits the target no one else can see." - Arthur Schopenhauer

Offline

#9 2025-04-12 23:19:03

Bob
Administrator
Registered: 2010-06-20
Posts: 10,740

Re: Sending a box containing several varieties of seeds with a total unit

It looks like a homework assignment. As a teacher I'd prefer that members don't just do the work for someone.  You could see if you can write a program but don't post it. That way if RegJose comes back with a request for specific help you're well prepared even if your version isn't quite what the assignment requires.

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#10 2025-04-14 18:57:53

ktesla39
Member
From: Nepal
Registered: 2024-10-08
Posts: 261
Website

Re: Sending a box containing several varieties of seeds with a total unit

Correct!
Are you a teacher? Cool.


"Talent hits the target no one else can hit. Genius hits the target no one else can see." - Arthur Schopenhauer

Offline

Board footer

Powered by FluxBB