Okay, you want to do it in sections. Why is this the optimal way? It sure does sound like you can do better than a linear search through the sections right?

Honestly, I set up the graph like this so I can use a scipy function, but then noticed that the version on CW is pretty old and didn't have the function. So I just implemented one myself it in essentially the most 'direct translation of algorithm idea' way possible.

Efficient? Probably not the most efficient, but I think it's likely good enough.

To go from A to A without moving, you just move zero steps. To go from A to A through a looping edge, you move one step by going through the looping edge.

An empty array is an array, simlarly an empty sequence of edges is an empty path. One that doesn't contain any - in the string representation i.e. no edges.

you are limited hence why you can only clear a certain amount of floors reliablely, I'm confused

Hence 2^(Eggs - 1) is the wrong way to think about this.

But I know you didn't say that, you said (2^(Eggs - 1) x (Tries - (Eggs - 1)) - 1).

Why does multiplying by Tries - (Eggs - 1) and subtracting one fix this? You never said anything about this and keep referring to the part 2^(Eggs - 1) instead. This is why I was asking about the multiplication.

Second, I would consider this the most optimal strategy, because again as stated previously...spliting the floors by half gives you equal probability of determing the correct floor. There by, giving you the most optimal chance of determining correct floors within new ranges.

If you do think this is already broken down into the most detailed reasoning possible, then okay.

The thing is, this is wrong. It only applies if you're not limited by the number of breaks you can tolerate (i.e. number of eggs.) Then:

(2^(Eggs - 1) x (Tries - (Eggs - 1)) - 1) = 895

It seems you're trying to adjust for the fact that you're limited in number of eggs by multiplying by Tries - (Eggs - 1). You have never explained why a multiplication is here, but alas it's also wrong. It's just not the optimal way to do this. Please explain why you think it's optimal.

Your entire line of thought is not going in the way the optimal solution works. I'm not saying that you need small adjustments here and there. In fact, that's why I want you to think more systematically. You already made like 3 adjustments, and you're still a long way off from the answer. You need a different approach. As for the reason that your approach isn't optimal, well I await a response from you on the things mentioned above.

I'm thinking of a way to demostrate you a method that work with a higher number of floors, but at the same time not spoiling the solution. I like the kata a lot and I think the description should have one just to show how things are done. That's also partly why I keep replying. But until then I really want you to address what I mentioned above, just so I can know where exactly went wrong, whether the description can be made clearer (it could be a simple misunderstanding!), and by the way I suggest you also make up your mind about the answer.

This is simple, by dividing the floors in half you have a equal chance of determining whether the floor is above or below. if we had 8 eggs to work with we could clear 128 floor sections

That only makes sense in some special cases. I'll leave figuring out the details to you.

Also, not really a second question because I'm asking about your reasoning as a whole, but why did you multiply by 14? Why is multiplying the right thing to do? Why is multiplying by one more than the number of tries minus the number of eggs right? That's still unexplained.

I ask for your reasoning, your thought process, on this: Why would you consider what you proposed to be the optimal strategy?

I am sure that 896 is not the maximum. There are ways to accurately work with more floors. But unless you explain your reason I cannot really even begin to explain it to you because I don't know where you did wrong. Do understand that even if what you wrote may look obvious to yourself, to me it's just putting the numbers in the question together in a random way, because I have no idea what you are thinking.

You're not really explaining it to me either. You just need to, as said, think more systematically.

I think you got how this kata works, but you still have not shown your reasoning about why any of the answers you gave above are really the maximum.

I encourage you to come up with a more systematic way of calculating the maximum number of floors, instead of just saying random stuff without showing the reason why you calculated like this.

This part is still unexplained. Even if you think it's obvious, I think you should try to spell out the procedure because my hunch is that it doesn't make sense as well.

There are two problems:

1280 really isn't the optimal way to do this.

It doesn't even work. By the time you reach the 20th segment of 64 floors, you only have one try left, so there's no way you can reliably & accurately clear the 64 floors.

The problem never states how egg breaking is determined

Not sure what you mean by 'determined', but you need to handle both the case where the egg breaks and the case where it doesn't, within the limits of eggs and tries. If you are talking about something like a function to call to determine whether the egg breaks when thrown from a certain floor here's no need for that. Otherwise conceptually you'll just throw and the eggs will behave according to the height.

So first I'm either too bad at reading to understand this (does happen from time to time, especially when I'm sleep, so sorry if that's what happened), but I'm mainly concerned about the fact that you didn't really explain why 20 tries means multiplying by 20 (as this is very likely a misunderstanding of the problem). The other thing is that I'm not sure where 70 came from, because again I feel like we aren't even talking about the same question at this point.

Well the thing is you don't have 20 tries 'of' 7 eggs. You have 20 tries and 7 eggs, and each throw consumes a try and may, depending on the outcome, consume an egg by cracking and breaking it.

It's like if you have 20 tomatoes and 7 eggs, and some dishes require only a tomato and others require a tomato and an egg. You can't say that since 7 eggs can feed 70 people, by adding 20 tomatoes you can feed 1400 people. That's not how the 'resources' work.

I don't really see where you got 70 from and why multiplying by 20 makes sense here.

Maybe an example would help? You currently have 7 eggs and 20 tries. If you throw an egg at floor 70 and it breaks, you know the answer < 70 and you have 6 eggs and 19 tries left. If it doesn't break you know it's >= 70 and also have 19 tries left but still have 7 eggs.

Not so much. There are worst katas ;)

Well that I can't really help too much because it's your job after all

You did sound like you were serious doubting the correctness of the given tests. I hope I at least partially addressed that.

Unaware doesn't mean it doesn't exist, so it does not constitute a reason.

Can you come up with a way to calculate exactly what strategy to use exactly instead of just coming up with random ones and see if they work?

Okay, you want to do it in sections. Why is this the optimal way? It sure does sound like you can do better than a linear search through the sections right?

Honestly, I set up the graph like this so I can use a scipy function, but then noticed that the version on CW is pretty old and didn't have the function. So I just implemented one myself it in essentially the most 'direct translation of algorithm idea' way possible.

Efficient? Probably not the most efficient, but I think it's likely good enough.

To go from A to A without moving, you just move zero steps. To go from A to A through a looping edge, you move one step by going through the looping edge.

An empty array is an array, simlarly an empty sequence of edges is an empty path. One that doesn't contain any

`-`

in the string representation i.e. no edges.Also, there's no probabality to be found in this problem. There's no randomness and every case

hasto work, exactly.Hence

`2^(Eggs - 1)`

is the wrong way to think about this.But I know you didn't say that, you said

`(2^(Eggs - 1) x (Tries - (Eggs - 1)) - 1)`

.Why does multiplying by

`Tries - (Eggs - 1)`

and subtracting one fix this? Youneversaid anything about this and keep referring to the part`2^(Eggs - 1)`

instead. This is why I was asking about the multiplication.If you do think this is already broken down into the most detailed reasoning possible, then okay.

The thing is, this is wrong. It only applies if you're not limited by the number of breaks you can tolerate (i.e. number of eggs.) Then:

It seems you're trying to adjust for the fact that you're limited in number of eggs by multiplying by

`Tries - (Eggs - 1)`

. You haveneverexplained why a multiplication is here, but alas it's also wrong. It's just not the optimal way to do this. Please explain why you think it's optimal.Your entire line of thought is not going in the way the optimal solution works. I'm not saying that you need small adjustments here and there. In fact, that's why I want you to think more systematically. You already made like 3 adjustments, and you're still a long way off from the answer. You need a different approach. As for the reason that your approach isn't optimal, well I await a response from you on the things mentioned above.

I'm thinking of a way to demostrate you a method that work with a higher number of floors, but at the same time not spoiling the solution. I like the kata a lot and I think the description should have one just to show how things are done. That's also partly why I keep replying. But until then I really want you to address what I mentioned above, just so I can know where exactly went wrong, whether the description can be made clearer (it could be a simple misunderstanding!), and by the way I suggest you also make up your mind about the answer.

That only makes sense in some special cases. I'll leave figuring out the details to you.

Also, not really a second question because I'm asking about your reasoning as a whole, but why did you multiply by 14? Why is multiplying the right thing to do? Why is multiplying by one more than the number of tries minus the number of eggs right? That's still unexplained.

I ask for your reasoning, your thought process, on this:

Why would you consider what you proposed to be the optimal strategy?I am sure that 896 is not the maximum. There are ways to accurately work with more floors. But unless you explain your reason I cannot really even begin to explain it to you because I don't know where you did wrong. Do understand that even if what you wrote may look obvious to yourself, to me it's just putting the numbers in the question together in a random way, because I have no idea what you are thinking.

You're not really explaining it to me either. You just need to, as said, think more systematically.

I think you got how this kata works, but you still have not shown your reasoning about why any of the answers you gave above are really the maximum.

I encourage you to come up with a more systematic way of calculating the maximum number of floors, instead of just saying random stuff without showing the reason

whyyou calculated like this.Why though

This part is still unexplained. Even if you think it's obvious, I think you should try to spell out the procedure because my hunch is that it doesn't make sense as well.

There are two problems:

Not sure what you mean by 'determined', but you need to handle both the case where the egg breaks and the case where it doesn't, within the limits of eggs and tries. If you are talking about something like a function to call to determine whether the egg breaks when thrown from a certain floor here's no need for that. Otherwise conceptually you'll just throw and the eggs will behave according to the height.

So first I'm either too bad at reading to understand this (does happen from time to time, especially when I'm sleep, so sorry if that's what happened), but I'm mainly concerned about the fact that you didn't really explain why 20 tries means multiplying by 20 (as this is very likely a misunderstanding of the problem). The other thing is that I'm not sure where 70 came from, because again I feel like we aren't even talking about the same question at this point.

Well the thing is you

don'thave 20 tries 'of' 7 eggs. You have 20 triesand7 eggs, andeachthrow consumes a try and may, depending on the outcome, consume an egg by cracking and breaking it.It's like if you have 20 tomatoes and 7 eggs, and some dishes require only a tomato and others require a tomato and an egg. You can't say that since 7 eggs can feed 70 people, by adding 20 tomatoes you can feed 1400 people. That's not how the 'resources' work.

I don't really see where you got 70 from and why multiplying by 20 makes sense here.

Maybe an example would help? You currently have 7 eggs and 20 tries. If you throw an egg at floor 70 and it breaks, you know the answer < 70 and you have 6 eggs and 19 tries left. If it doesn't break you know it's >= 70 and also have 19 tries left but still have 7 eggs.

## Loading more items...