Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 27th, 2005, 1:24 PM   #1
skuinders
Hobbyist Programmer
 
skuinders's Avatar
 
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4 skuinders is on a distinguished road
Petals Around the Rose

See if you can solve this

http://crux.baker.edu/cdavis09/roses.html

DON'T POST THE ANSWER
warning: this may piss you off after a while of not getting it!

I got it after about 9 minutes... I know some people in other forums who have spent days on it. After I solved it, I tried to see if a neural network could find a way to generate correct petal counts.

I encoded the dice roll data as follows:
N = number of rolls
ND = number of dice in each roll

the input is a NxND matrix of random values from 1 to 6
the class (desired output) vector holds the petal count corresponding to each row (roll) of the input matrix

using a simple backpropagation NN, it is not possible to solve this problem as encoded the above way because of the inherent non-linearity of the problem. (if you plot the 2D case, you can clearly see that the petal counts are not linearly separable and a simple non-linear function is not immediately clear either).

there are other (more trivial) ways you could encode the roll information and make it work, but such models would be of little use.


I know I beat things to death.... anyways, have fun!
__________________
"A stupid man's report of what a clever man says can never be accurate, because he unconciously translates what he hears into something he can understand."
- B. Russell

http://web.bryant.edu/~srk2

Last edited by skuinders; Jun 27th, 2005 at 1:32 PM.
skuinders is offline   Reply With Quote
Old Jun 27th, 2005, 2:49 PM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,100
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
OH I GET IT...that's good, very good.

That actually took me a while, just thinking outside the box worked for me. And it's sort of a big hint if you hit the check button when all the dice are 1s.

Good one, thanks for that.

The stupid part is, is you could figure it out without even knowing how you did it (I won't say anymore else I may give it away).


Edit: Just for fun I made a program in C++ that solves it for you. :p www.1v7.com/drsane/petals.exe But even if you tore open the code, it still wouldn't tell you why it works.
__________________
Looking for tough programming challenges? Try participating in Sane's Monthly Algorithms Challenges!
Composing Techno is a little side hobby of mine. Techno by DJ Sane. All free for download.

Last edited by Sane; Jun 27th, 2005 at 3:18 PM.
Sane is online now   Reply With Quote
Old Jun 27th, 2005, 3:36 PM   #3
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
That was a good one. Took me a while to get it.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote
Old Jun 27th, 2005, 4:43 PM   #4
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
that was ridiculous.. it only took 3 rolls... bah!
__________________
-Steven
"Is this a piece of your brain?" - Basil Fawlty
stevengs is offline   Reply With Quote
Old Jun 27th, 2005, 5:04 PM   #5
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I remember doing this a few years back - took me a bit of time, but it was fun.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Jun 27th, 2005, 5:38 PM   #6
Navid
Hobbyist Programmer
 
Navid's Avatar
 
Join Date: Feb 2005
Location: Canada
Posts: 187
Rep Power: 4 Navid is on a distinguished road
Send a message via MSN to Navid
took me 5 or 6 rolls, suprised i got it actually
Navid is offline   Reply With Quote
Old Jun 27th, 2005, 6:15 PM   #7
thechristelegacy
Expert Programmer
 
thechristelegacy's Avatar
 
Join Date: Jul 2004
Location: Somerset, Pa
Posts: 708
Rep Power: 5 thechristelegacy is on a distinguished road
Send a message via AIM to thechristelegacy Send a message via MSN to thechristelegacy
pretty nifty, I'd like to make my own version of this game in a differnt language now
thechristelegacy is offline   Reply With Quote
Old Jun 27th, 2005, 8:28 PM   #8
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,100
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
I already just basically did in C++. >_>

www.1v7.com/drsane/petals.exe

Not hard. Considering I don't even know C++. <_<
:p
__________________
Looking for tough programming challenges? Try participating in Sane's Monthly Algorithms Challenges!
Composing Techno is a little side hobby of mine. Techno by DJ Sane. All free for download.
Sane is online now   Reply With Quote
Old Jun 27th, 2005, 8:54 PM   #9
Navid
Hobbyist Programmer
 
Navid's Avatar
 
Join Date: Feb 2005
Location: Canada
Posts: 187
Rep Power: 4 Navid is on a distinguished road
Send a message via MSN to Navid
Quote:
Originally Posted by Sane
I already just basically did in C++. >_>

www.1v7.com/drsane/petals.exe

Not hard. Considering I don't even know C++. <_<
:p
Then how did you program it in C++?
Navid is offline   Reply With Quote
Old Jun 27th, 2005, 9:06 PM   #10
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,100
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
Part of being a programmer is having adaptability.
__________________
Looking for tough programming challenges? Try participating in Sane's Monthly Algorithms Challenges!
Composing Techno is a little side hobby of mine. Techno by DJ Sane. All free for download.
Sane is online now   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:39 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC