I agree with your statement that "Logically you should always make the decision that has the best prospective outcome", but disagree on your assumption that the "best prospective outcome" is measured...
Type: Posts; User: Lenggries
I agree with your statement that "Logically you should always make the decision that has the best prospective outcome", but disagree on your assumption that the "best prospective outcome" is measured...
That's the key... you CAN'T play the (actual) game 1000 times. You only get to play once, and at least in the US version, you're generally dealing with life-altering quantities of money. This is why...
I'm afraid your going to have to roll your own algorithm. This forum discussion includes an excellent post on Deal or No Deal, including a few actual examples from the American version of the show....
It's only too much if you don't want the correct answer. With some smart pruning (aka, not entering branches if you can determine that no useful work can be done there), the algorithm can be...
Exactly, except for two things:
- instead of (64,20-(i+j+k+l)), you'd use (96,20-(i+j+k+l)), where 96 = 120 cards - 24 aces
- You'dd definitely need to use a larger numeric datatype. A long is only...
So it seems. It's a interesting mix of combinatorics, but the proof is in the pudding:
- both algorithms I've shown produced the same answer for number of hands without aces around
- that answer...
Basically, yes. As it turns out, this is much easier than I expected. In c#, again (and using the same Choose() function in my earlier post:
private long[] CalculateAll()
{
long[] total...
First of all, as a lifelong Pinochle player, I'm tempted to ignore this post entirely on the principle that you are playing it wrong. Double deck? That's like eating tofurkey on Thanksgiving!
...
Yeah... what Jemidiah said.
But to go further, why are you mucking around with Integers at all? In your comments you linked to a forum post which gave you your getnode() function, and the only...
Your problem is that you are sorting the names of the nodes and not the nodes themselves. When you swap things within SortChild(), you are merely swapping the names. Instead, you need either swap the...
Repetition, repetition, and repetition.
Once your son gets into more advanced math, such as trigonometry, there are a few tricks to the trade. For example, if in a test in which the students may...
It looks like some sort of spread or datagrid control to me. I know you can recreate that interface using Farpoint's spread control, but I suspect there are other options out there as well.
I suggest you think about this problem a little differently. Given any word of n letters, you have (n-1) slots where a period could appear. Think of those slots like binary number with (n-1) digits....
What are you trying to verify? The user's input? Just compare it to the "txt" parameter you passed to MakeCaptchaImage()
Post your algorithm and we'll try to debug it for you.
D'oh! Alright, I think I've got it right this time (although it is definitely not an elegant proof). I corrected my own solution in post #2. Please review.
Highlight over solutions
Part 1:
Fermat's Little Theorem states that a^(p-1) := 1 mod p. for 1 <= a < p. Let p = 31, which is prime, and a = 239, then 239^30 := 1 mod p.
Further, 30^239 :=...
I'm just taking a stab here, but if you want to know the location of a pixel in a rotated image, I think these formulas should do it.
Given
Origin = (x0, y0)
Pixel = (xp, yp)
Rotation angle =...
This is a really trivial algebra question. You have two points (x1,y1) = (2.0, 0.9) and (x2,y2) = (3.75, 0.8), and want to find (x3,y3) = (2.85, ???) (aka you want to solve for y3 given x3 = 2.85)....
One interesting feature is that, given strictly commutative operators, the variable a will appear at the left most position at least once in ever set of equivalent formulas. Alternatively, given a...
Well, it should be possible to count permutations while subtracting trivially equivalent permutations, by which I mean it should be easy to discount b*a given that I am counting a*b. The problem is...
Hey there, you're supposed to print the solution in invisible ink :rolleyes:
I'd already figured out that 352 (and thus 368, which is 6! - 352) were strong candidates for non-construction. I was...
Well, that goes along the second to last category, of disprovable (or alternatively, (dis)provable by contradiction). In this case, however, that's not a trivial matter. Even if you find a number...
There are many ways to skin a cat, so to speak. Jemidiah likes to make me lose sleep with these puzzles, but I have resisted thinking too much about this one so far. I tend to categorize these kinds...
Yeah, that's the same 'trick' I used as well. The only caveat to using it is the statement "Any point on the rim of a hemisphere counts as being in both hemispheres", which I took to be an...
In the example you linked to, you can forget about the CList class... it's completely unnecessary and only there for the comfort of that writer.
Again, using the example of the code you linked to,...
A couple of ways come to mind. The most flexible method is to define a custom class. But a shortcut might be to just declare a custom type:
Private Type Foo
ID As Long
Data() As Long...
Let's start at the basics: y = f(x)
In this case, x is the input of a function and y is the output. Whatever function f() may represent doesn't really matter, except to understand that it has a...
This is just a remapping problem of a curve. You say you want to use a logarithm, so the first question is, since the base is what shapes the log curve, what base?
Whatever you decide, let's...
Thanks for keeping me from falling asleep this weekend!
#2 is kind of like a trick question. It can seem difficult to prove until one hits upon the trick, at which point the solution is pretty...
This is basic basic geometry, barely touching into elementary trig. The only thing that's not particularly intuitive is their calculation Angle field. The Sin() and Cos() functions apparently take...
I think you guys may be overthinking the problem, or else I'm misinterpreting the OP. It seems the definition of 'perfect circle' requires the array contain all points within the boundary of the...
I'm reading between the lines here, simply because your explanation gives me little other option. I assume this is some sort of RPG where you are attempting to calculate hit percentage or something...
VB6 Doubles don't give you 15 digits of precision.
Glad I gave you a chuckle. I had to abbreviate my last post as I was getting called to a meeting, so it ended up more cliché than I would've liked. I agree that computer science fundamentals is...
Personally, I think all of VB has a limited future. VB only works on one platform (Windows), and the language itself is hardly ever taught anymore. On the flip-side, teaching any C-Style language...
Generally speaking, multiplication is much faster than division, so instead of dividing, you can multiply by the reciprocal. For example, 12.5 / 10 = 1.25 is slower than 12.5 * 0.1 = 1.25
Thus, if...
That's not a popup window. It's a lightbox. Not that I have any idea how to do what you want, but now that you know the name of your problem, you should be better able to search for a solution.
OP can refer to "original post" or "original poster" interchangeably. In my post, I meant OP to refer to original poster, aka you.
Frankly, your code is a garbled mess, and I can't make out entirely what you are trying to do. That said, a few minor changes should get you what you need, and I love the theme of the program. Here's...