MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Programming Probability of puzzle in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg44904] Re: [mg44901] Programming Probability of puzzle in Mathematica
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Mon, 8 Dec 2003 02:29:14 -0500 (EST)
  • References: <200312071103.GAA29637@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

The answer is almost 0. There is "essentially", only one magic square 
of order 3. By rotating it you can produce 3 more. You can also reflect 
it in a vertical line and then apply three possible rotations. This 
gives you 8 possible magic squares. On the other hand, the number of 
ways of inserting numbers 1 to 9 into the possible 9 places is 9^9. So 
the probability of getting a magic square after your 1000 tries is 
about 0.00002. Thus there is an overwhelming probability that you will 
never see one. In fact the whole idea of generating such "unlikely" 
patterns at random is quite hopeless.

Andrzej Kozlowski



On 7 Dec 2003, at 20:03, art burke wrote:

> Hi to all:
>
> Not being a programmer, but yet inquisitive, I'd like to come up with
> several small programs that compute the probability of random numbers
> being
> inserted into let's say, a magic cube, triangle, or such that all
> rows, columns, and diagonals add up to a certain number.
>
> Let's say a 3x3 magic square, using the numbers 1,2,3,4,5,6,7,8 and 9.
> Of course, if you know how to put them into the magic square, all
> rows, diagonals, and columns add up to 15.
>
> Having Mathematica insert random numbers in cells, compute all sums
> and see if it has it correct, and keep up the repetions until it comes
> up with an average probability, let's say after 1000 tries....What
> would be the probability?
>
> I've been quit interested in this for a while, but am wondering how it
> would be done??
>
> Thanks for all the help,
>
> Art
>
>


  • Prev by Date: Re: How to stop a kerne calculationl without stopping the frontend
  • Next by Date: Re: Programming Probability of puzzle in Mathematica
  • Previous by thread: Programming Probability of puzzle in Mathematica
  • Next by thread: Re: Programming Probability of puzzle in Mathematica