|
has it been proved whether or not there are a finite number of twin primes yet?
Russell
|
|
|
|
|
The Twin Prime Conjecture is still a conjecture.
"Oh, what a tangled web we weave, when first we practice to deceive." - Sir Walter Scott
Web - Blog - RSS - Math - LinkedIn - BM
|
|
|
|
|
It cant be proven that a finite number exists... can it? because there is an infinite number of... numbers!
|
|
|
|
|
Just the fact that the set of integers is an infinite set does not in any way impact the provability. There are numerous other conjectures which have been proven on this set of (all integer) numbers. One common technique is to assume the conjecture is false, then demonstrate that such an assumption leads to a contradiction, therefore the opposite must be true.Some examples of proven and open conjectures[^]
|
|
|
|
|
It can; you just can't check it directly (that is, by checking each number).
For instance, even though there are infinitely many natural numbers, you can prove that there are an infinite number of primes, but only a finite number of even primes:
Proof there are an Infinite number of primes > 1:
Assume there are a finite number of primes, and call them p_1, p_2, ..., p_n.
Think of the number p_1 * p_2 * ... * p_n + 1. This number is bigger than any of the primes, and so it can't be a prime itself. But if you try to divide that number by any of the primes, you'll always end up with a remainder of one, and so the new number must be a prime itself. But that is a contradiction, because we assumed the only primes were p_1 through p_n. Because our hypothesis leads to a contradiction, it must be false. Thus, there must be infinitely many primes.
Proof there are a finite number of even primes:
Any even number is divisible by 2. Because 2 != any even number greater than 2, any even number greater than 2 is divisible by a number that is neither equal to 1 nor to itself. Since there are only finitely many even numbers equal to 2 or less (only one, which is two itself), there are only a finite number of even primes.
Basically, by using different techniques that let you talk about abstract sets of numbers, including infinite sets, you can prove things about infinite sets of things, without having to check each and every number individually (which is of course impossible).
So even though it hasn't been proven mathematically (yet) whether or not there are infinitely many twin primes, it should be possible. (Although there is a famous mathematical theorem that says that there are mathematically true statements that cannot be proven, so there is a slim chance that this theorem might be one of those. On the other hand, nothing like this has been found yet, outside of some very abstract statements that were used to prove that very theorem itself, so most likely a proof can be found.)
|
|
|
|
|
I have 6 floats, and each one has a weighting (lets represent the weighting by another float). Now I can get an overall score for the values by getting the sum of all the values multiplied by their weighting, however this will only give me an absolute value, with no reference point, unless I compared a number of different sets. Is there any way to ‘normalize’ the data, for example to get a percentage value. I could use an absolute reference point, but it would either need to be set higher than I would expect the overall score to ever get, or I would end up with scores greater than 100% (when the score gets above the reference score).
I do remember using Probability Density Functions with Normal Distributions to normalize data back in the day, however I’m not sure if this would work for what I have, or if it did would probably be pretty complex.
Any thoughts on the matter would be greatly appreciated.
|
|
|
|
|
I think that you can use the relative score, i.e.
rel_score(i)= value(i)*weight(i)/overall_score
if you like a percentage, then multiply it by 100.
Hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
is there any one that can help me with my programe, in c++ to load a image of a car, do sobel to find edges and perform hough tranform to find the license plate.
i am getting lots of errors and iam stuck, i need some help or example code.
the sobel funtion below, iam getting errors can someone suggest a fix.
void CShowImageDlg::OnSobel()
{
// TODO: Add your control notification handler code here
BITMAP bm;
m_bmpBitmap.GetBitmap(&bm);
BYTE *image = (BYTE *) bm.bmBits;
BYTE *out;
BYTE *p1, *p2, *p3;
int width = bm.bmWidth;
int height = bm.bmHeight;
int h,w,ctr=0;
p1 = image; p2 = p1+width; p3 = p2+width;
for (h=0;h
|
|
|
|
|
Hi,
1.
I think something is wrong in the line p1 += 2; p2 += 2; p3 +=2;
isnt the idea here to move to the next scanline ?
2.
I suspect the Bitmap class also has a "stride" or "scanwidth" indicating the exact
distance you should move forward to get to the next scanline. It is not necessaraly true
that stride=width. I am not familiar with the details, but have a look at BitmapData
and LockBits.
3.
may I suggest you use pre and /pre tags to isolate code snippets; it (almost) preserves
all white space; and finally there is a checkbox that prevents HTML interpretation (so
your less than operators dont get eaten, see your for statements). Unfortunately if
you check it, pre tags dont work anymore...
Good luck with your image processing !
Luc Pattyn
|
|
|
|
|
I´m looking for a algorithm to calculate the sun up. Who can help me.
|
|
|
|
|
Can you be more specific? Do you mean to say that you need a function to calculate when sunrise is? In different timezones? It's hard to tell what you are talking about.
|
|
|
|
|
Rigth, I need fucntion to calculate when sunrise is.
|
|
|
|
|
|
daniel99 wrote: I´m looking for a algorithm to calculate the sun up. Who can help me.
The Sun API DLL[^]
but if you prefer the algorithms itself (not a DLL) then you might want to look at the bottom Middle of this[^] (Ben always has to go add stuff before I reference it )
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Does anybody know of a path finding algorithm that can find the longest path as opposed to the shortest? This is to be used in a tile based game where I have to connect two tiles using 3 or less lines. The longer the line the higher the score and the least number of lines the higher the score.
I am familiar with the Astar algorithm and have been trying to modify it to suit my needs. I'm not sure exactly how I should calculate the movement cost. I'm thinking I should give a high cost to a direction change and a low cost to a short line. But I can't get it to work correctly
|
|
|
|
|
WalderMort wrote: I'm not sure exactly how I should calculate the movement cost.
1/dist. What this does is say that the longer the distance, the shorter the cost, the result is the A* suddenly starts thinking the longer path is the better one. You can still use large numbers for cost to designate running into lines, etc to stop the path.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
http://siderite.blogspot.com/2007/01/super-fast-string-distance-algorithm.html[^]
I hope I am not reinventing an old and rusty wheel, even if I am sure someone somewhere had the same idea as I did, however, I didn't find it on Google, so I am presenting this algorithm I've created to compare two strings, as a fast replacement for Levenstein.
I think it's pretty accurate for its speed. I have tested it on 60000 company detail records and the average dispersion from levenshtein is 3%, with 15% max, and the greatest errors when strings were fairly different in length. (when strings are equal in length, the average error is 1%)
So, I submit this is a good algorithm to see if strings are similar or fairly different, leaving it to levenshtein to compute exact distance values when sift2 values go above a certain threshold. The complexity is almost linear O(n*constant). What do you guys think?
-- modified at 9:46 Wednesday 10th January, 2007
-- modified at 5:05 Tuesday 16th January, 2007
Made it slightly faster and a lot more precise.
|
|
|
|
|
Siderite Zaqwedex wrote: What do you guys think?
It's an interesting read. Seems like you should write an article on it.
|
|
|
|
|
I'm trying to build a postfix parser for some kind of expressions. I used stack and so on I got the result correctly with binary operator.
But when I add in factorial sign "!" things got messed up.
For example: 3+4 --> 3 4 +
But 3! + 4 --> 3 4 ! + or 3 ! +4 (it take "+" as a signed value)
How should I treat this case ? The correct result should be 3 ! 4 +, but because "!" isnt an operand, my algorithm just treat it as other operator.
Any solution ? Thanks for reading
|
|
|
|
|
Hi,
first rule in postfix is: push operands on operand stack
a) if you dont have any operator yet (in "awaiting operand" state), or
b) if you dont have enough operands yet.
so with "3 + 4" you push 3 because of a) and 4 because of b)
but with "3! + 4" you push 3 because of a) and you execute ! as soon as it has all its
operands (only one), so the 3 gets popped from operand stack and the result of 3!
gets pushed, before dealing with the + and the 4
That's what monadic operators are about
remark: there are two kinds of monadics: compare -3 and 3!
Luc Pattyn
|
|
|
|
|
Thanks for your reply.
But my problem is I do NOT want to calculate the result of 3! before hand, because I'm using that to build a parse tree, and for some other reasons, I have to convert the infix expression into postfix before using that postfix expression to build the tree.
Is there a solution for this ?
Me newbie
|
|
|
|
|
OK,
the postfix of 3+4 is 34+ (operands first, then operator)
so the postfix of -3 is 3- (you may want use two different minus symbols, one for biadic,
one for monadic, although even in postfix it is clear: there is only one operand available)
and the postfix of 3! is 3! (again operand(s) first, then operator).
Luc Pattyn
|
|
|
|
|
Thanks, I think I got some hold of it now.
Currently my algorithm is like this:
-If next token is an operand, add it to output array, change state to not readingOperator
-If next token is an operator:
------If state is readingOperator, and token is + or -, acknowledge it as signed value
------If state is not, change state to readingOperator.
------If operator is "!", add it to output array, and change state to not readingOperator
------If operator stack is empty, push token into stack
------If top of operator stack is a higher precedent operator, pop it out and add to output array. Repeat this step.
------If top of operator stack is a lower precedent operator, push token into operator stack.
-Repeat till there is no more token.
Will this algorithm be ok ? Is there any problem with it ?
|
|
|
|
|
Well, it may be right, it sure is close. I am not going to check all the details for you,
you should figure it out yourself
I suggest you experiment with say 5 expressions, first symbolically
(=parsing), then by executing your postfix as well as the original to compare results.
So you could try e.g.
6*5+4
6+5*4
if allowed by your input language also 6*(5+4) and the like
once all of these are correct, you could try longer expressions (but it would be hard
to mess them up once you got the basics)
so now is the time to replace one of the numbers by -2 or by 3!
if you know how to handle parentheses, you could introduce functions such as in 3+sqrt(4*5)-2
this is not very hard
and if you think everything is fine, then go for exponentiation:
6+5^4 (looks simple)
but what about: 2^3^2 (remember, exponentiation goes right-to-left,
whereas ! does not, so 3!! is nothing special but 2^3^2 is)
but don't try the more difficult ones as long as the simpler ones are not absolutely correct
It is up to you how far you want to go...
Luc Pattyn
|
|
|
|
|
Thanks, it's good to know I'm on the right track.
|
|
|
|
|