Empty Boxes Invariant/Algorithmic Problem

  • Thread starter SpunkyDonutz
  • Start date
  • Tags
    Empty
In summary: Medium Boxes in them18 Large Boxes that have 7 Medium Boxes in them18(7) = 1268 of the 18 Large Boxes that have Medium Boxes in them, would have Small Boxes in them8(7) = 56126 + 56 = 18225 + 175 = 200200 + 182 = 382291 - 382 = 91I'm really sorry, I'm having a lot of trouble with this, I know I'm being a pain but I've been stuck on this for hours :/It's probably just me being stupid but I'm having trouble understanding, and having a bit of difficulty recognising what is what. In summary,
  • #1
SpunkyDonutz
29
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
  • #2
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.
 
  • #3
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!
 
  • #4
SpunkyDonutz said:
So essentially the assignment should look something like this?
e := (25 - L) + (8 - M) + 8

why? :confused:

(and shouldn't there be some 7s in there?)
 
  • #5
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).
 
  • #6
you mean (25 - L) + (7 - M) + 7 ?

but what about that huge number of medium boxes that end up empty? :confused:
 
  • #7
I'm confused now :confused:
 
  • #8
the medium boxes that don't have small boxes inside are all empty
 
  • #9
I know that much, I'm just confused about how to work that out
 
  • #10
sorry, but we're not going to give you the answer

you'll have to work it out​
 
  • #11
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)
 
  • #12
SpunkyDonutz said:
e := (25 - L) + (7 - m) + (7 - s)

?? :confused:

explain​
 
  • #13
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
 
  • #14
SpunkyDonutz said:
7 - M = the amount of empty medium boxes

why?? :confused:
 
  • #15
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?
 
  • #16
??

is L the number of large boxes that are filled?

if so, what is total number of medium boxes?​
 
  • #17
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?
 
  • #18
SpunkyDonutz said:
8*L?

you mean 7*L

and the total number of small boxes?
 
  • #19
tiny-tim said:
you mean 7*L

and the total number of small boxes?

That would be 7*M
 
  • #20
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:
 
  • #21
(25 - L) - (7 - 7L) - (7 - 7M)?

25 + 7M would be for the total of L and M
 
  • #22
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:​
 
  • #23
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
 
  • #24
(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 ?​
 
  • #25
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:
  • #26
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 ?​
 
  • #27
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
 
  • #28
how did you get 18 and 21 ? :confused:

anyway, the question asks for the final total number of empty boxes
 
  • #29
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
 
  • #30
SpunkyDonutz said:
trial and error

that's no way to pass an exam :redface:

ii] what is the formula for the total number of all boxes (in terms of L and M), that has to be 291 ?​
 
  • #31
tiny-tim said:
that's no way to pass an exam :redface:

ii] what is the formula for the total number of all boxes (in terms of l and m), that has to be 291 ?​

(7*25) + 25 = 200
 
Last edited:
  • #32
Which leaves enough space for 13 medium boxes to be filled with small boxes.
 
  • #33
tiny-tim said:
ii] what is the formula for the total number of all boxes (in terms of L and M), that has to be 291 ?​

SpunkyDonutz said:
(7*25) + 25 = 200

there's no L or M in that :redface:
 
  • #34
tiny-tim said:
there's no l or m in that :redface:

(7l) + 25
 
Last edited:
  • #35
SpunkyDonutz said:
(7l) + 25

so far, so good :smile:

what about M?​
 
Back
Top