Jump to content
BrainDen.com - Brain Teasers

plasmid

VIP
  • Posts

    1756
  • Joined

  • Last visited

  • Days Won

    25

Everything posted by plasmid

  1. That looks like it nailed it, PG! As for a way of saying it in under a minute...
  2. I'll call that a hit. My thinking was...
  3. Getting warmer, but I'll definitely cause you (the listener of the riddle) more calamity if my insides get out and have my own "peaked wave" in the sea to sit under (mostly).
  4. Not a balloon, something else that's more characteristically under a peaked wave and mostly concealed.
  5. On the right track, but I get more riled up upon harpooning.
  6. Not a sink disposal. While I imagine the last stanza has happened with some of those, I hope it's not commonplace enough to belong in a riddle.
  7. On the right track, but not quite there yet.
  8. I feast on meals of mindless fare With blubber to keep it all in For what’s inside should stay right there Or you’ll face a calamitous end ‘Neath peaking wave I spend the days While mostly conceal’d, I presume Unless my presence breath betrays As characteristic’s my spume Alas, I find myself engaged By man with a wretched harpoon Assaulted thus, I shriek enraged With hellish retort for the goon
  9. How I'm interpreting it so far:
  10. Is there an easier way to reach the solution? If I try to handle the case of an infinite number of princes to choose from, and I deal with the exact formula I was working with initially instead of the simplified approximation that I ended up using to be able to actually calculate an answer, then I get
  11. I know of a way to do this while flipping no more than two coins. And a hint:
  12. I’m going to make the math easier by
  13. I changed the way the algorithm works, so that it more systematically checks all possible paths for all possible mazes and is guaranteed to eventually find the shortest possible set of instructions that will solve every maze of size n x n. The bad news is that it takes a long time to run. Even after doing what I could to make this run reasonably efficiently, it still could only process a 3 x 3 maze and will take a while to process even a 4 x 4 maze, albeit on a crummy laptop. If this was a question posed to programmers, and the person asking the question knew full well that the numbers would get huge fast (checking all possible instructions for a 17 step solution would mean checking 417 = 17 billion potential solutions against almost 4000 mazes for the 4 x 4 case) and was making the point that you'll need to come up with something other than exhaustive brute force (sort of like the algorithm I had earlier but probably a smarter version), then it would make sense. At any rate, this is a solution for any 3 x 3 maze with the shortest possible number of moves.
  14. This is a start but not a complete answer. If you care only about whether the Princess picks the Most Wonderful Prince, and don’t care whether a failed attempt gets her the second best guy or the village donkey because you consider anything less than the best to be a loss:
  15. It reached a final set of instructions for a 5 x 5 maze, which I'm sure you're all dying to see... This will work (unless my program is buggy), but I would be surprised if this is anywhere near optimal. And I'm not going to attempt a 10 x 10.
  16. Was this a problem posed to a bunch of programmers? A solution for any 4x4 maze (although IDK whether or not this is an optimal one) is But when I tried running the algorithm to solve any 5x5 maze, it's been running for a while and still hasn't found a solution. I can't guarantee that this approach will find one. I'll paste the perl code below.
  17. I agree with Rainman; we need a description of how the marbles were selected to be placed into the jar in the first place. If you were to say that someone flipped a fair coin 100 times and put a white marble in the jar if he saw head and a black marble in the jar if he saw tails, then that would be enough of a description to take on the problem. And I bet the answer would be a lot different if someone picked a random number from 0 to 100 with equal probability and put N white marbles and 100-N black marbles in the jar.
  18. Ah, the hospital's rule. Of course. I vaguely remember that from high school. More importantly, I also found out that my memory of integration by parts was faulty, and that seems to have been the real issue. From the top:
  19. If you do that and the (uv) term is x(F3-1), then at x=infinity wouldn't you end up with infinity times zero? If there's a rule about the limit of multiplication between x and functions with e-x as x goes to infinity, then maybe I could use that in the route I was taking.
  20. Two more clarification questions
  21. Is it allowable to design a key that can open multiple different locks? If each lock has multiple positions where a subset of the pins at each position (potentially at different positions for each lock) need to be raised to the correct height in order to be opened, then it would be fairly straightforward to design one key for each general while still using the total number of locks in the answers above. If you're limited in how many positions the pins of a lock can be in, then things might get complicated.
  22. So if you have N coins to choose from, instead of needing log2N coins to specify its position you can guarantee that you only need (log2N / 2) + 1 flips. Nice move to halve the upper limit, but with 1000 coins you could still be in for an hour of nyan. That might work well for random configurations ... the math to figure out how many flips it would take on average would be difficult and maybe worth being its own question. But the worst case scenario if the bazillion coin is in the middle, the left half is all heads, and the right half is all tails would be a real pain.
×
×
  • Create New...