Empty Boxes Invariant/Algorithmic Problem

  • Thread starter Thread starter SpunkyDonutz
  • Start date Start date
  • Tags Tags
    Empty
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
55 replies · 9K views
SpunkyDonutz
Messages
29
Reaction score
0
I've been trying to figure this out for a couple of hours and I just don't know how to work it out, I have attempted to create a valid statement for the algorithm, but I just don't know what I'm doing.

I would be greatly appreciative for any help I could get on this.

Thanks!

Homework Statement



Twenty-five large empty boxes are placed on a table. An unknown
number of the boxes is selected and, into each, seven medium boxes are placed. An
unknown number of the medium boxes is selected and, into each, seven small boxes
are placed.

At the end of this process there are 291 boxes in total. How many empty boxes
are there? You should use the following steps in order to solve the problem.

1. Introduce the variables e and t for the number of empty and the number of
total boxes, respectively.
2. Identify the information that is given about the initial and final values of e and
t.
3. Model the process of putting seven boxes inside a box as an assignment to e
and t.
4. Calculate an invariant of the assignment.
5. Combine the previous steps to deduce the final value of e .

Homework Equations


The Attempt at a Solution


Initial:
e = 25
t = 291
Final:
e = ?
t = 291

(e-t)[e, t := e+7, t-1]
=
(e+7) – (t-1)
=
e-t-5
 
Last edited:
Physics news on Phys.org
Hi SpunkyDonutz! Welcome to PF! :smile:
SpunkyDonutz said:
Twenty-five large empty boxes are placed on a table. An unknown number of the boxes is selected and, into each, seven medium boxes are placed. An unknown number of the medium boxes is selected and, into e ach, seven small boxes are placed.

At the end of this process there are 291 boxes in total. How many empty boxes are there?

The question is asking for the total number of empty large boxes, plus empty medium boxes, plus all the small boxes (since they're all empty anyway).

Try the first stage (before any of the small boxes have arrived) … if n large boxes are filled, how many empty boxes are there? … then try the final stage.
 
So essentially the assignment should look something like this?
e := (25 - L) + (8 - M) + 8

and the invariant is going to be t - e?

Thanks for the reply too!
 
Derp, I meant 7 instead of 8 :$

Well if there's 25 large boxes in total, and L amount of filled boxes, you would substitute L from 25.
And you would do the same with the medium boxes.
Then add them up and add the amount of small boxes on (since they're always empty).
 
I'm confused now :confused:
 
I know that much, I'm just confused about how to work that out
 
tiny-tim said:
sorry, but we're not going to give you the answer

you'll have to work it out​

I know, I don't expect the answer, just hopefully something that'll help flick the switch.
Is this more along the right lines?
e := (25 - L) + (7 - m) + (7 - s)
 
tiny-tim said:
?? :confused:

explain​

25 - L = the amount of empty large boxes
7 - M = the amount of empty medium boxes
7 - S = the amount of empty small boxes
 
tiny-tim said:
why?? :confused:

Ahh, I see what you mean now...

7-7M

7M - because there are 7 boxes placed and M are full?
 
tiny-tim said:
??

is L the number of large boxes that are filled?

if so, what is total number of medium boxes?​

Yeah, L, M and S are the total amount filled.
8*L?
 
tiny-tim said:
you mean 7*L

and the total number of small boxes?

That would be 7*M
 
yes :smile:

ok so what is the total number of empty boxes?

(and what is the total number of all boxes, in terms of L and M?)

btw, i didn't notice …
SpunkyDonutz said:
Yeah, L, M and S are the total amount filled.
… no, none of the small boxes are filled :redface:
 
(25 - L) - (7 - 7L) - (7 - 7M)?

25 + 7M would be for the total of L and M
 
tiny-tim said:
sorry, you've really confused me, I've lost track of what you say L and M are

i'm going to bed, we'll have another go tomorrow :zzz:​

Alright, thanks a lot for the help, I really appreciate it! :smile:
Night mate!

L is the number of full large boxes.
M is the number of full medium boxes.

I think I should have had:
(25 - L) - (7L - M) - 7M

(25 -L) Total number of empty large boxes
(7L - M) Total number of empty medium boxes
7M Total number of small boxes
 
(just got up :zzz:)
SpunkyDonutz said:
L is the number of full large boxes.
M is the number of full medium boxes.

(25 -L) Total number of empty large boxes
(7L - M) Total number of empty medium boxes
7M Total number of small boxes

yes! :smile:

(btw, do you see how straightforward it is if you choose a sensible notation, and carefully rewrite everything step by step in that notation?)
(25 - L) - (7L - M) - 7M

minus?

ok, now:
i] simplify that (after you've corrected it)
ii] what is the total number of all boxes (in terms of L and M), that has to be 291 ?​
 
tiny-tim said:
i] simplify that (after you've corrected it)
ii] what is the total number of all boxes (in terms of L and M), that has to be 291 ?

(25 - L) + (7L - M) + 7M

25 + 6L + 6M?

25 Large Boxes in total
175 Medium Boxes in total

18 of the 25 Large Boxes would have to be used
Meaning 126 medium boxes are used, and 21 of those boxes would be used
Giving 147 small boxes.

18+126+147 = 291
 
Last edited:
SpunkyDonutz said:
25 + 6L + 6M?

yes :smile:

and let's write that 25 + 6(L+M)
25 Large Boxes in total
175 Medium Boxes in total

why 175??
18 of the 25 Large Boxes would have to be used
Meaning 126 medium boxes are used, and 21 of those boxes would be used
Giving 147 small boxes.

i don't understand this

ii] what is the total number of all boxes (in terms of L and M), that has to be 291 ?​
 
tiny-tim said:
why 175??

25 * 7 = 175, so that is the max amount of medium boxes that are able to be used.

tiny-tim said:
i don't understand this

ii] what is the total number of all boxes (in terms of L and M), that has to be 291 ?​

If 18 large boxes are filled and 21 medium boxes are filled, it gives us the total of 291.

18 large boxes
18*7 = 126 medium boxes
21*7 = 147 small boxes

Giving us:
18+126+147 = 291

Unless I've misunderstood the initial question, this should be correct
 
tiny-tim said:
how did you get 18 and 21 ? :confused:

trial and error

tiny-tim said:
anyway, the question asks for the final total number of empty boxes

25 + 6(18+21) = 259