Jump to content

Welcome to BrainDen.com - Brain Teasers Forum

Welcome to BrainDen.com - Brain Teasers Forum. Like most online communities you must register to post in our community, but don't worry this is a simple free process. To be a part of BrainDen Forums you may create a new account or sign in if you already have an account.
As a member you could start new topics, reply to others, subscribe to topics/forums to get automatic updates, get your own profile and make new friends.

Of course, you can also enjoy our collection of amazing optical illusions and cool math games.

If you like our site, you may support us by simply clicking Google "+1" or Facebook "Like" buttons at the top.
If you have a website, we would appreciate a little link to BrainDen.

Thanks and enjoy the Den :-)
Guest Message by DevFuse


Member Since --
Offline Last Active Yesterday, 03:04 AM

#341631 Otto never loved Yolanda

Posted by plasmid on 18 February 2015 - 05:04 PM

Spoiler for

  • 1

#341630 Universal Truth Machine

Posted by plasmid on 18 February 2015 - 04:55 PM

Spoiler for I would go with this statement:

  • 1

#341504 Segments on a line

Posted by plasmid on 06 February 2015 - 07:45 PM

Spoiler for proof that 1 being false implies 2 being true

  • 1

#341480 The n-gon eats out

Posted by plasmid on 31 January 2015 - 04:35 PM

Spoiler for proof by contradiction

  • 2

#341208 Empty a peg and marry a Princess (difficult)

Posted by plasmid on 02 December 2014 - 08:34 AM

There were two questions posed.
1) Can you clear out a peg?
2) How would you do it?
A little surprisingly, I can answer the second question but not the first.
Spoiler for

  • 1

#340959 Upside Down Cake

Posted by plasmid on 06 November 2014 - 03:51 AM

I'm not sure we're completely understanding each other, but here goes.
Spoiler for

  • 1

#340958 Marked Hat

Posted by plasmid on 06 November 2014 - 03:28 AM

Spoiler for

  • 1

#340259 Freebirds

Posted by plasmid on 20 September 2014 - 03:40 PM

Spoiler for

  • 1

#339452 optimal game strat

Posted by plasmid on 12 August 2014 - 04:40 AM

Here's a concrete example.

I tried modifying the code so it generates a matrix of steps to get from each starting point to each goal, just like the matrix I posted earlier, and runs from 1 to 30 so I could directly compare the matrices they produce. They differ at some spots, one of which is the path going from 11 to 3. For some reason it took four steps and went 11/11=1, 11+11=22, 22/11=2, 2+1=3. Obviously a shorter path would be 11/11=1, 1+1=2, 1+2=3.

Apparently there are two equally short paths from 11 to 2: {11/11=1, 1+1=2} and {11+11=22, 22/11=2}, and the algorithm ended up storing the second path as the most efficient path to get to 2. However, since it didn't store the path to 2 that creates 1 as an intermediate rather than 22, it wasn't able to discover that you could reach 3 from a path going to 2 through 1 that had a useful intermediate already generated.
  • 1

#339390 optimal game strat

Posted by plasmid on 06 August 2014 - 07:21 AM

I've been trying to figure out what makes your code run so much faster, and I think I can more or less follow its logic but I'm not sure about one point. If you wanted to get from a starting point of 1 to an ending point of 7, you could do that with

With the algorithm, after you get one path with
1, 2, 4
and another path with
1, 2, 3
it looks like the first of those sets wouldn't allow you to add 4 in the next round because there is already a different path to reach 4, and the second of those sets wouldn't allow you to add 3 in the next round because there is already a different path to reach 3. (This is from the next if (exists($m->{$result})); line.) I'm wondering if it would have a way of discovering that path to 7?

For the most part our algorithms seem to agree, but when I set the max size for both algorithms to 30, mine said you can go from 25 to 13 in 4 steps (from the matrix in my earlier post) while yours said that 25 to 13 took 6 steps (when I commented out the
if ($start{$s}{$STEPS} == $start{$start_best}{$STEPS}) {
and subsequent close bracket surrounding the print statement). A path with four steps is:
25/25 = 1
25+1 = 26
1+1 = 2
26/2 = 13
  • 1

#339107 I'm not a rebellious missionary

Posted by plasmid on 16 July 2014 - 06:14 AM

Heaven sent with company
Clad in cloaks of four or three
Straight and narrow I'll not be
Thus my fate is cast

Sawn asunder as you're fain
In coffin uninterred lie slain
'neath ice with blood-stained ball and chain
Gouged until the last
  • 0

#339028 Sacrifice Mice

Posted by plasmid on 13 July 2014 - 06:54 PM

That should work. I had a different answer in mind.
Spoiler for

  • 1

#338758 Max. # of convex/concave hexagons possible using 6 points

Posted by plasmid on 27 June 2014 - 05:17 AM

Spoiler for a few more

  • -1

#338697 First 2014 puzzle. Dissection of a triangle

Posted by plasmid on 22 June 2014 - 10:09 PM

Spoiler for revised answer with changes in red

Edit: added the figure back
  • -1

#338691 First 2014 puzzle. Dissection of a triangle

Posted by plasmid on 22 June 2014 - 04:55 PM

Drat. I just looked over that again and saw that I divided instead of multiplying when manipulating that equation after introducing the deltaA term, so it won't work.

  • -1