-
Posts
1267 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
Events
Gallery
Blogs
Everything posted by superprismatic
-
-
Perhaps I should play nice like Molly Mae does.
-
A Bingo Card Puzzle (A very lengthy math puzzle)
superprismatic replied to bhramarraj's question in New Logic/Math Puzzles
In case anyone is interested in a short description of how I got the solution: -
A Bingo Card Puzzle (A very lengthy math puzzle)
superprismatic replied to bhramarraj's question in New Logic/Math Puzzles
Thanks! This was a very nice puzzle. It made me do a lot of analysis before I could get the work factor down to the point where I could write a program to complete the solution. -
A Bingo Card Puzzle (A very lengthy math puzzle)
superprismatic replied to bhramarraj's question in New Logic/Math Puzzles
-
edit - getting formatting right is a puzzle of it's own... Yes, you've got it!
-
yet another wieghing problem
superprismatic replied to phil1882's question in New Logic/Math Puzzles
Actually, we are working on the same problem. But since nobody posted anything for a day and a half, I thought I would throw out some gray code thoughts. So, I can go through the gray code scheme mindlessly and am able to determine any weight in at most 369 moves. The average time is about half of that. The gray code is much too restrictive, however, because it counts moving a weight from one pan to another as two moves (the OP has it as one). I was going to try other things along a modified gray code line when I get some time in a day or two. I may be barking up the wrong tree, but it's fun to play with this stuff. It's good to see that the Captain is working on this and I suspect that he'll get to the bottom of this one before I do. -
yet another wieghing problem
superprismatic replied to phil1882's question in New Logic/Math Puzzles
-
yet another wieghing problem
superprismatic replied to phil1882's question in New Logic/Math Puzzles
I retract my answer (in the spoiler above). I must have had a brain fog when I replied. I hope this didn't keep anyone from working on this problem. -
I have taken the standard A-Z alphabet and permuted it in such a way that the permuted alphabet starts with a long English word. The object of this puzzle is to determine my permuted alphabet. For clues, I give you five sets of pairs of letters. Each set has the property that every pair of letters within that set are the same distance apart, in the same direction, in my permuted alphabet. Furthermore, each set uses a distance/direction pair which is not used in any other set. For example, if my permuted alphabet were ACEGIKLNPRTVXBDFHJLNPRTVXZ Two of my sets may be {AG,LR,HN,XC,ZE,KP} and {BA,DC,FE,HG,JI} in which case, the first set represents pairs of letters where the second of the pair is three away to the right of the first letter of the pair (AG has G three to the right of A; XC has C three to the right of X) or, equivalently, 23 away to the left of the first letter. The second set contains pairs which contain pairs of letters which are 13 apart from each other. Notice that the alphabet is considered cyclic and counting is done 'around the corner'. The five sets are: Set 1: {EF,HA,IH,QV,TB,WZ,ZN} Set 2: {JA,KB,QE,WJ,ZM,HO,UQ,BR,RU,CV} Set 3: {AK,CH,DV,FW,JX,NG,QN,TJ,UI,VO,WP,YB,ZR} Set 4: {LC,UD,NF,QH,BN,JR,RS,ST,GW} Set 5: {CD,GS,HV,KY,TW} Can you find my permuted alphabet which starts with a long English word?
-
Equations with the Floor Function
superprismatic replied to James33's question in New Logic/Math Puzzles
-
Touring the chessboard with a single die
superprismatic replied to bonanova's question in New Logic/Math Puzzles
#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_up,dir_left,dir_right, dir_error,dir_error,dir_back,dir_front,dir_up,dir_up, dir_error,dir_error,dir_front,dir_back,dir_down,dir_down, dir_error,dir_error,dir_right,dir_right,dir_back,dir_front, dir_error,dir_error,dir_left,dir_left,dir_front,dir_back, dir_error,dir_error,dir_error,dir_error,dir_error,dir_error, dir_error,dir_error,dir_error,dir_error,dir_error,dir_error}; dir tilt(dir cur, dir tiltdir) { int val = cur*num_dirs+tiltdir; return tiltarray[val]; } void printdir(dir cur) { switch (cur) { case dir_front: cout << "1"; break; case dir_back: cout << "6"; break; case dir_up: cout << "^"; break; case dir_down: cout << "v"; break; case dir_right: cout << ">"; break; case dir_left: cout << "<"; break; default: cout << " "; break; } } void drawgrid() { for(int i = 0; i < GRIDSIZE*2+1; i++) cout << "_"; cout << endl; for(int j = 0; j < GRIDSIZE; j++) { cout << "|"; for(int i = 0; i < GRIDSIZE; i++) { printdir(facing[j*GRIDSIZE+i]); //printdir(move[j*GRIDSIZE+i]); if (i <= GRIDSIZE-2) { if ((move[j*GRIDSIZE+i]==dir_right) || (move[j*GRIDSIZE+i+1]==dir_left)) { cout << "="; } else { cout << " "; } } } cout << "|" << endl; if (j <= GRIDSIZE-2) { cout << "|"; for(int i = 0; i < GRIDSIZE; i++) { if ((move[j*GRIDSIZE+i]==dir_down) || (move[(j+1)*GRIDSIZE+i]==dir_up)) { cout << "|"; } else { cout << " "; } if (i < GRIDSIZE-1) cout << "X"; } cout << "|" << endl; } } for(int i = 0; i < GRIDSIZE*2+1; i++) cout << "-"; cout << endl; } int validmove(dir tiltdir, int verbose) { if (((tiltdir==dir_up)&&(hist.back()<GRIDSIZE)) || ((tiltdir==dir_down)&&(hist.back()>=(GRIDSIZE-1)*GRIDSIZE)) || ((tiltdir==dir_right)&&(hist.back()%GRIDSIZE==GRIDSIZE-1)) || ((tiltdir==dir_left)&&(hist.back()%GRIDSIZE==0))) { if (verbose) cout << "Invalid move: Boundary hit." << endl; return 0; } if (facing[hist.back()+displacement[tiltdir]] != dir_error) { if (verbose) cout << "Invalid move: Repeating a square." << endl; return 0; } if ((tilt(facing[hist.back()],tiltdir)==dir_front) && (hist.back()+displacement[tiltdir] != GRIDSIZE-1)) { if (verbose) cout << "Invalid move: 1 would be facing up." << endl; return 0; } return 1; } int solved() { if ((hist.size()==GRIDSIZE*GRIDSIZE) && (hist.back()==GRIDSIZE-1) && (facing[hist.back()] == dir_front)) return 1; return 0; } int main(int argc, char *argv[]) { hist.push_back(0); for(int i = 0; i < GRIDSIZE*GRIDSIZE; i++) { facing[i] = dir_error; move[i] = dir_error; } facing[0] = dir_front; drawgrid(); while (1) { int ch = getchar(); dir tiltdir = dir_error; switch (ch) { case 'w'://up tiltdir = dir_up; break; case 's'://down tiltdir = dir_down; break; case 'd'://right tiltdir = dir_right; break; case 'a'://left tiltdir = dir_left; break; case ' '://undo tiltdir = dir_undo; break; case 'k'://solve it hist.clear(); hist.push_back(0); for(int i = 0; i < GRIDSIZE*GRIDSIZE; i++) { facing[i] = dir_error; move[i] = dir_error; } facing[0] = dir_front; hist.reserve(GRIDSIZE*GRIDSIZE+1); while(!solved() && hist.size() > 0) { //if (hist.size() > GRIDSIZE*(GRIDSIZE-1)+6) //{ // drawgrid(); // getchar(); //} dir nextone = dir_error; switch(move[hist.back()]) { case dir_error: nextone = dir_up; break; case dir_up: nextone = dir_down; break; case dir_down: nextone = dir_right; break; case dir_right: nextone = dir_left; break; case dir_left: nextone = dir_undo; break; default: cout << "Should never get here!!" << endl; } if (nextone == dir_undo) { if (hist.size() <= 1) break; facing[hist.back()] = dir_error; move[hist.back()] = dir_error; hist.pop_back(); continue; } move[hist.back()] = nextone; if (validmove(nextone,0)) { dir temp = tilt(facing[hist.back()],nextone); hist.push_back(hist.back()+displacement[nextone]); facing[hist.back()] = temp; move[hist.back()] = dir_error; } } if (solved()) cout << "Found solution!" << endl; else cout << "No solution??" << endl; drawgrid(); break; default: break; } if (tiltdir == dir_error) continue; if (tiltdir == dir_undo) { if (hist.size() <= 1) continue; facing[hist.back()] = dir_error; hist.pop_back(); move[hist.back()] = dir_error; drawgrid(); continue; } if (validmove(tiltdir,1)) { move[hist.back()] = tiltdir; dir temp = tilt(facing[hist.back()],tiltdir); hist.push_back(hist.back()+displacement[tiltdir]); facing[hist.back()] = temp; } drawgrid(); } }#include <stdio.h> Very nice, EventHorizon! I was just about to write a backtracking program when I saw that you beat me to it. I was going to have mine check to see if there were any other ending grid squares besides square 8. I never programmed in C++, so I can't decipher your code. I ran it and it took about 3 minutes on my machine to come up with the solution you posted. Would it be easy to modify your code so that it looks for endpoints (with the 1 up) other than square 8? Congrats! -
-
Good job all! How does one prove optimality here?
-
Guess the number, binary style
superprismatic replied to bonanova's question in New Logic/Math Puzzles
-
-
Johnny Dangerously's pet store
superprismatic replied to bonanova's question in New Logic/Math Puzzles
-
-
Nice work, plasmid!
-
RoboThrow is a robot which shoots free throw basketball shots. Once it is set up to shoot, RoboThrow always makes its first shot and misses its second shot. The probability of RoboThrow making any subsequent shot depends on its previous shots by this simple rule: If RoboThrow has made X previous shots and has missed Y previous shots, it will make the next shot with probability X/(X+Y) or, equivalently, it will miss it with probability Y/(X+Y). What is the probability that RoboThrow will make 75 of its first 100 shots?
-
-
I think the solution still works if the word "unique" is removed from the problem statement. N'est pas?
-
-
There's one other answer such that all the variables are integers! Did anyone find that one?
-
I thought about it for a while, but I couldn't see an analytic solution to the problem. So I just wrote a little program to solve it. By the way, there are no other solutions.