Jump to content
BrainDen.com - Brain Teasers


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by EventHorizon

  1. #include <stdio.h> #include <stdlib.h> #include <iostream> #include <memory.h> #include <vector> using namespace std; #define GRIDSIZE 8 enum dir { dir_front = 0, dir_back = 1, dir_up = 2, dir_down = 3, dir_right = 4, dir_left = 5, num_dirs = 6, dir_error = 7, dir_undo = 8 }; dir facing[GRIDSIZE*GRIDSIZE]; dir move[GRIDSIZE*GRIDSIZE]; vector<int> hist; int displacement[8] = {0,0,-GRIDSIZE,GRIDSIZE,1,-1,0,0}; dir tiltarray[] = {dir_error,dir_error,dir_up,dir_down,dir_right,dir_left, dir_error,dir_error,dir_down,dir
  2. At position 5 the 1 is on top of the die again breaking that constraint. Unless, that is, if I'm misreading the constraints.
  3. I assume this is in reponse to my statement about order doesn't matter. I did explain that statement in post #21. The search does depend on the set of previous guesses and responses (just not on the order of them to get to that point) to decide the next sequence of cards to guess. So if we guess all red, and we get a response (which tells us the total red and total black cards)... the search should definitely be different based on the response given (though perhaps not initially in that exact scenario... I'm not sure yet).
  4. I can beat bub's 1. Just ask, "wait, how many cards are there to guess for now?" And it would be 2 to the 26th power... assuming the only possible replies were "twenty-six" or "you didn't get all of them." That problem would be like a blind person trying to solve a rubik's cube, and asking "is this it?" and the other person saying "nope." (Was it the movie UHF that had that?) Agreed. I was actually writing a similar post when I noticed Time Out already did the job before my post was ready. I thought about commenting on bonanova's "factorial or exponential" comment in that post... so
  5. For those who read my last spoiler anyway...
  6. I debated as to whether I should write the answer yet, but that's what spoiler boxes are for, right? So if you don't have a good answer to this question... don't read the spoiler! [spoiler=Don't read this unless you already know what it says ]Things on your right, stay on your right. Things on your left, stay on your left. Things above eye level, stay above eye level. Things below eye level, stay below eye level. So how, since nothing is flipped, is his/her right hand raised when your left is?
  7. If anyone actually tests it out or uses it, let me know what you think and if you want me to add an option or change something. Edit: Also... I have no idea how it happened, but a b was capitalized (or maybe even more errors introduced) in the line "unsigned int n = (~(a ^ & mask;" in the getCorrect method. I didn't notice any other strange capitalizations introduced, but they may be there.
  8. Hopefully you don't think I'm being too harsh here. It's just thought and observations before and after testing the method with my code. And speaking of code... here it is for those who know c++. Welcome to the Den
  9. [spoiler= ]14... and once I figure out how/why it works, I'll let you know. (cmon computer, tell me the method, not just a bunch of numbers!) This isn't necessarily the limit, but the result of a greedy search that took 14 guesses to resolve to a single guessed possibility (assuming the response given to a guess was always the one that left the most possibilities). So it might be 15, but probably not 16. Unless a greedy search doesn't produce the best strategy, which is entirely possible, then it might be 12 or 13. So I guess I'm saying 14+/-2.
  10. I was rushing out the door when I posted this thread, so here's a quick clarification. When I say total dates, I meant both mother and child triples included. 'total' should have been replaced with the words 'either mother or child' or 'any type of' in front of 'Pythagorean triple' in both question 2 and 3. For question 2, I mean per century (ie, ignore wrap around, which would make the answer infinite). For question 3 and 4, I meant any number of digits for the year, so it never wraps around to 0. For question 4 it makes the answer the last one that will ever happen.
  11. Yes, I know Mother's Day is the much bigger deal (Happy Mother's Day to all mothers out there! I hope you feel loved and appreciated every day of the year.). However, today's date is a Pythagorean triple (5/13/12, 52+122=132), so I thought I'd post some math questions regarding Pythagorean triples. But first, here are some definitions to those who don't know what Pythagorean triples are: The Pythagorean theorem states that for a right triangle whose sides are of length a, b, and c where c is the longest length (the one opposite the right angle), a2+b2=c2. If all three of a,b, and
  12. Amiab is right. On a side note, that is close to question 2 from my modifications I linked to earlier (though I used an analog clock as my example... so 12 holes).
  • Create New...