<div>yes power towers are allowed</div>
<div> </div>
<div>exponentiation, multiplication, division, addition and subtraction. Brackets when necessary but length is sorted on number of digits not number of operators plus digits.</div>
<div> </div>
<div>I always try my homework myself first. in 38 years of life I've learned only to do what i want, if I wanted everyone else to do my work for me I'd be a management consultant !<br></div>
<div class="gmail_quote">On Fri, Feb 20, 2009 at 3:52 PM, Luke Dunn <span dir="ltr"><<a href="mailto:luke.dunn@gmail.com">luke.dunn@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>I am teaching myself coding. No university or school, so i guess its homework if you like. i am interested in algorithms generally, after doing some of Project Euler. Of course my own learning process is best served by just getting on with it but sometimes you will do that while other times you might just choose to ask for help. if no one suggests then i will probably shelve it and come back to it myself when I'm fresh.</div>

<div> </div>
<div>no it's not a real world problem but my grounding is in math so i like pure stuff anyway. don't see how that is a problem, as a math person i accept the validity of pure research conducted just for curiosity and aesthetic satisfaction. it often finds an application later anyway</div>

<div> </div>
<div>Thanks for your helpful suggestion of trying other methods and i will do that in time. my motive was to share an interesting problem because a human of moderate math education can sit down with this and find minimal solutions easily but the intuition they use is quite subtle, hence the idea of converting the human heuristic into an algorithm became of interest, and particularly a recursive one. i find that the development of a piece of recursion usually comes as an 'aha', and since i hadn't had such a moment, i thought i'd turn the problem loose on the public. also i found no online reference to this problem so it seemed ripe for sharing.<br>
<br></div>
<div>
<div></div>
<div class="Wj3C7c">
<div class="gmail_quote">On Fri, Feb 20, 2009 at 3:39 PM, Nigel Rantor <span dir="ltr"><<a href="mailto:wiggly@wiggly.org" target="_blank">wiggly@wiggly.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Trip Technician wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">anyone interested in looking at the following problem.<br></blockquote><br></div>if you can give me a good reason why this is not homework I'd love to hear it...I just don't see how this is a real problem. 
<div><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">we are trying to express numbers as minimal expressions using only the<br>digits one two and three, with conventional arithmetic. so for<br>
instance<br><br>33 = 2^(3+2)+1 = 3^3+(3*2)<br><br>are both minimal, using 4 digits but<br><br>33 = ((3+2)*2+1)*3<br><br>using 5 is not.<br><br>I have tried coding a function to return the minimal representation<br>for any integer, but haven't cracked it so far. The naive first<br>
attempt is to generate lots of random strings, eval() them and sort by<br>size and value. this is inelegant and slow.<br></blockquote><br></div>Wow. Okay, what other ways have you tried so far? Or are you beating your head against the "search the entire problem space" solution still?<br>
<br>This problem smells a lot like factorisation, so I would think of it in terms of wanting to reduce the target number using as few operations as possible.<br><br>If you allow exponentiation that's going to be your biggest hitter so you know that the best you can do using 2 digits is n^n where n is the largest digit you allow yourself.<br>
<br>Are you going to allow things like n^n^n or not?<br><font color="#888888"><br> n<br><br><br></font></blockquote></div><br></div></div></blockquote></div><br>