I hope I'm ok with putting this in General Chat. It's not so much a Progress issue as just a problem I have understanding some logic. It could be in any language you like - I just happen to be working in Progress for this.
I need to work out a way of doing something. I'm translating the actual problem into apples and conveyor belts so it's more relevant for you!
A conveyor belt has n apples on it. When they get to the end they fall off into one of 2 bags. This is of course totally random. One bag is on the left (L) the other is on the right (R). I need to map out all the different possibilities there are for the apples to fall. Obviously there are 2^n possible results. I'll include a couple of examples.
1 apple
L R
2 apples
LR RL LL RR
3 apples
LLL LLR LRL RLL RRL RLR LRR RRR
I hope that makes sense. How would you go about working out these different combinations?
I need to work out a way of doing something. I'm translating the actual problem into apples and conveyor belts so it's more relevant for you!
A conveyor belt has n apples on it. When they get to the end they fall off into one of 2 bags. This is of course totally random. One bag is on the left (L) the other is on the right (R). I need to map out all the different possibilities there are for the apples to fall. Obviously there are 2^n possible results. I'll include a couple of examples.
1 apple
L R
2 apples
LR RL LL RR
3 apples
LLL LLR LRL RLL RRL RLR LRR RRR
I hope that makes sense. How would you go about working out these different combinations?