• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Fun math paradoxes, problems, and stuff

Status
Not open for further replies.
Level 7
Joined
Apr 27, 2011
Messages
272
Here is an old problem I liked off a high school math competition I participated in a few years ago. You don't actually need to know very much math at all to solve it.

A piece of software generates random numbers between 0 and 1. It is designed so that for every x between 0 and 1, the probability that it will generate a number smaller than x is three times the probability that it will generate a number smaller than x/4. Moreover, the probability that it will generate a number higher than or equal to x is the same as the probability that it will generate a number smaller than 1 - x. Calculate the probability that this program will generate a number smaller than 1/21.

real no. or integers???
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
Real numbers obviously. Otherwise, I'm not even sure if the problem would make any sense
(There would only be 0 and 1 to consider. The second statement implies that the probability of generating 0 is the same as the probability of generating 1, so they both have 50% chance of being generated. But the first statement implies that the probability of generating 0 is the 3 times the probability of generating 0, which is silly unless this probability is 0. So yeah, real numbers)
 
Level 6
Joined
May 5, 2008
Messages
210
I'm only in Year 11!

Somehow i found the condrum easiery. And btw I'm year 10.(no not 10 years old)

and to this one

Sort of like this conundrum :p

3 men go into a motel. The man behind the desk said the room is $30, so each man paid $10 and went to their room.

A while later the man behind the desk realized the room was only $25, so he sent the bellboy to the 3 guys' room with $5. On the way, the bellboy couldn't figure out how to split $5 evenly between 3 men, so he decides to give each man US$1 and kept the other $2 for himself.

This implies that the 3 men each paid $9 for the room, which is a total of $27. Adding the $2 that the bellboy kept brings the total to $29.

30=29

The bold one is wrong. You have to say the man each paid 9, so 27 are splited between 25 for the room and 2 for the bellboy. Btw why this 3 guys share a room in a cheap motel?
 
Level 7
Joined
Apr 27, 2011
Messages
272
Real numbers obviously. Otherwise, I'm not even sure if the problem would make any sense
(There would only be 0 and 1 to consider. The second statement implies that the probability of generating 0 is the same as the probability of generating 1, so they both have 50% chance of being generated. But the first statement implies that the probability of generating 0 is the 3 times the probability of generating 0, which is silly unless this probability is 0. So yeah, real numbers)

if integers can be used as answer i would have eventually answered 50% (from the question ofc) :/
for reals 100% perhaps since x/4 and 1-x cancels each other or if we assume that the range between real 0 and 1 is infinite the probability would be 0%. (btw, im not really god at analyzing word problems)
 
Last edited:
Level 20
Joined
Apr 22, 2007
Messages
1,960
Alain.Mark said:
for reals 100% perhaps since x/4 and 1-x cancels each other or if we assume that the range between real 0 and 1 is infinite the probability would be 0%. (btw, im not really god at analyzing word problems)
I don't understand what you're suggesting, but the answer is not 0%.

If I'd had said, "What is the probability of generating the number 1/21", then the answer would be 0% because the interval contains infinitely many real numbers (I could probably elaborate on this but I won't because it's unnecessary), but since I'm asking for the probability of generating any number smaller than 1/21 (which is an interval containing infinitely many real numbers as well), then you should reconsider.
 
Level 6
Joined
May 5, 2008
Messages
210
If I'd had said, "What is the probability of generating the number 1/21", then the answer would be 0% because the interval contains infinitely many real numbers (I could probably elaborate on this but I won't because it's unnecessary), but since I'm asking for the probability of generating any number smaller than 1/21 (which is an interval containing infinitely many real numbers as well), then you should reconsider.

if u want a number below 1/21 the change may be 1/21*100% so 3,somethiung?
 

fladdermasken

Off-Topic Moderator
Level 39
Joined
Dec 27, 2006
Messages
3,688
Right, I'll post a problem from an old booklet I came across.

dy/dt=ay
Let u be a solution to the aforementioned differential equation.

Set w=ue-ax and demonstrate how w'=0
Yeah, I was bored.
Oh well done you :D
The bold one is wrong. You have to say the man each paid 9, so 27 are splited between 25 for the room and 2 for the bellboy.
Correct.
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
Right, I'll post a problem from an old booklet I came across.

dy/dt=ay
Let u be a solution to the aforementioned differential equation.

Set w=ue-ax and demonstrate how w'=0

w' = u'e-ax - au e-ax
Since u satisfies the D.E., then u' = au
w' = au e-ax - au e-ax = 0

Wee.

Here's an interesting one. If you haven't studied any analysis, it will be hard as shit and I'll just post a solution (that I think is correct (it was on a final exam)) if nobody gets anywhere. Also, I'm bringing out the LaTeX because fuck writing limits in a normal post:

EU3qs.gif



nhLvP.gif

 
Last edited:
Level 6
Joined
Mar 29, 2004
Messages
109
Here's a "paradox", if you can call it that. When I was reading some of Zero: The Biography of a Dangerous Idea, it apparently said something along the lines of "any number divided by zero equals any number divided by zero".

So a statement like this would be correct:

Code:
45/0 == 978/0

Therefore, since they are both equal, you can simplify it by crossing out the zeros, since they cancel each other out, and you will get this:

Code:
45 == 978

In this way he demonstrated that, because of zero, all numbers equal all other numbers. He also explained that this also means that, mathematically, anything in the universe is possible. If there are 0 elephants on my head, there are also 200 elephants on my head. If I have 2 arms, I also have 4 arms.

I think you could call that a paradox.

hogwash! in another time he would be burned at the steak for such witchery! :)
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
Here is an old problem I liked off a high school math competition I participated in a few years ago. You don't actually need to know very much math at all to solve it.

A piece of software generates random numbers between 0 and 1. It is designed so that for every x between 0 and 1, the probability that it will generate a number smaller than x is three times the probability that it will generate a number smaller than x/4. Moreover, the probability that it will generate a number higher than or equal to x is the same as the probability that it will generate a number smaller than 1 - x. Calculate the probability that this program will generate a number smaller than 1/21.

Here is a solution for those who cba to try it:


Let P(X >= x) be the probability of generating a number greater than or equal to x, and P(X < x) be the probability of generating a number less than x. Then, using what's given about the number generator, we know that:
(1) P(X < x) = 3 P(X < x/4)
(2) P(X >= x) = P(X < (1-x))
Also, since we're just dealing with probabilities, it should be clear that:
P(X >= x) + P(X < x) = 1

Now,
P(X >= 1/21) = P(X < 20/21) = 3 P(X < 5/21)

and,
P(X >= 5/21) = P(X < 16/21) = 3 P(X < 4/21) = 9 P(X < 1/21)

So we have the following:
(1/3) P(X >= 1/21) = P(X < 5/21)
9 P(X < 1/21) = P(X >= 5/21)

Recall that:
P(X >= 1/21) + P(X < 1/21) = 1, and
P(X >= 5/21) + P(X < 5/21) = 1, so we end up with the following system of equations:

P(X >= 1/21) + P(X < 1/21) = 1
(1/3) P(X >= 1/21) + 9 P(X < 1/21) = 1

Solving for P(X < 1/21), we get 1/13.

More about that here.
 
Last edited:
Level 20
Joined
Apr 22, 2007
Messages
1,960
Here's a cool problem I found while browsing xkcd:

So, let's say you are prisoner of an evil dictator, which will give you a chance to give you back your freedom if you win at this little game :
He has put 100 boxes in a room, and every box has a number from 1 to 100. Additionally, each box contains a card with a number between 1 and 100. Those numbers are chosen randomly, several boxes can contain cards with the same number.
When you enter the room, you have to chose one box, and open it. If the card it contains has the same number as the box itself, then you win. If it does not, then you are allowed to open the box with the same number as the card you just found, provided it still has not been opened. You can open as many boxes as you need to, the game stops when the number on the card is the same as the one on the box that contained it (you win), or when the number on the card matches a box that has already been opened (you lose).

Short example : You chose box 10, it contains card 20. You open box 20, it contains card 20, you win.
You chose box 10, it contains card 20. You open box 20, it contains card 10, box 10 has already been opened, you lose.

So, it is obviously not a question of strategy, the question is to determine the winning probability.
 
Level 7
Joined
May 13, 2011
Messages
310
Obvious, un-mathematical answer: 0. The guy is an evil dictator, he is simply toying with your hope. He has set up the cards in the boxes so that none of them contain a card with the same number as the box.
 
Level 17
Joined
Apr 3, 2010
Messages
1,101
Here is one....For your calculator
X=3
(1-X)^2-X2=Y
Set X=Y
Repeat
You end up getting back to 3...
Why is this

To simulate this on Calculator to see all terms ---
3=
(1-ans)^2-ans^2
hit = button loads



@Hindy would the solution be something like.. (1/100)^100 -(101x100/2)?
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
Your answer is a negative number, which doesn't make any sense.
The answer is approximately 0.1220996063. There is no nice way of writing the answer out.

Also, I can't get your problem to work. Here's what I'm doing:

f(x) = (1 - x)2 - x2 = 1 - 2x
Denote fn(x) as f(f(...f(x))), where f is applied n times. Then:
fn(x) = 1 - 2(1 - 2(1 - 2(...))) = 1 - 2 + 22 - 23 + ... + (-2)n-1 + (-2)nx
= (1 - (-2)n)/3 + (-2)nx
= 1/3 + (-2)n(x - 1/3)

Plugging in x = 3,
fn(3) = 1/3 + (-2)n*8/3

We're looking for an n different from 0 such that fn(3) = 3. This is obviously impossible since the exponential function is injective, or you could just solve for n and see that the only possible answer is n = 0. So yeah, I feel like I've misunderstood something pretty big.
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
After dicking around for far too long, all I can tell is that they're prime (except for 1, but this might be for other reasons).
1 is 0th
3 is 2nd
7 is 4th
23 is 9th
89 is 24th
and I can't find a sequence in 0, 2, 4, 9, 24 either (nor 1, 3, 5, 10, 25). I'm probably way over-analyzing this, but whatever. I'll think about it more in a while.
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
Ah, okay. And yeah @ 1.

I got something very close to your sequence though. The initial seed is 2. Then,
xn+1 = largest prime strictly less than (xn + 1)*n + 1. This gives:
x0 = 2
(2 + 1)*1 + 1 = 4 => x1 = 3
(3 + 1)*2 + 1 = 9 => x2 = 7
(7 + 1)*3 + 1 = 25 => x3 = 23
(23 + 1)*4 + 1 = 97 => x4 = 89

lol

Haha this edit was done before your post!
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
Magtheridon96 said:
I'm trying to use a WC3 library to detect patterns in prime number intervals, but I can't seem to find any >.<
lol

Anyway, yeah, there were several such similar sequences I found while trying to find the first you suggested. I JUST ALWAYS COME SO CLOSE EVERY TIME E.G.
xn+1 is the smallest odd prime strictly greater than xn*n - (n-1)
x0 = 1
1*1 - 0 = 1 => x1 = 3
3*2 - 1 = 5 => x2 = 7
7*3 - 2 = 19 => x3 = 23
23*4 - 3 = 89 OH FUCK

there are like 3 other sequences I found like this -____-
 
Level 17
Joined
Apr 3, 2010
Messages
1,101
Your answer is a negative number, which doesn't make any sense.
The answer is approximately 0.1220996063. There is no nice way of writing the answer out.

Also, I can't get your problem to work. Here's what I'm doing:

f(x) = (1 - x)2 - x2 = 1 - 2x
Denote fn(x) as f(f(...f(x))), where f is applied n times. Then:
fn(x) = 1 - 2(1 - 2(1 - 2(...))) = 1 - 2 + 22 - 23 + ... + (-2)n-1 + (-2)nx
= (1 - (-2)n)/3 + (-2)nx
= 1/3 + (-2)n(x - 1/3)

Plugging in x = 3,
fn(3) = 1/3 + (-2)n*8/3

We're looking for an n different from 0 such that fn(3) = 3. This is obviously impossible since the exponential function is injective, or you could just solve for n and see that the only possible answer is n = 0. So yeah, I feel like I've misunderstood something pretty big.

Right Could just try (1-Ans)²-Ans² = 1²-Ans²-Ans²
I.e 1-1²-1²=-1
1--1²--1²=3
1-3=-2, So -2²=4 so 4-3²=-5=
1--5=6²=36 while 5² =25
So it goes from (1--5)²--5² to 36-25=11

If you see what i mean.. This can be done on a calculator using the ans function to take the last step the you repeat.

Your not meant to solve it . Just explain why it loops ^^

Also note N cant be 0
For (1-0)²-0²=1

Oh and @Magtheridon There is no pattern in primes, if you find one it will not worker with all numbers. So the only way to simulate a way of finding primes is to take away every multiple of 2 3 5 7 And you will be left with only primes.
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
Right Could just try (1-Ans)²-Ans² = 1²-Ans²-Ans²

Except that's wrong.
(1 - Ans)² - Ans² = (1² - 2Ans + Ans²) - Ans² = 1 - 2Ans
Given the expression you've written, I've found that it cannot loop.

Brambleclaw said:
Oh and @Magtheridon There is no pattern in primes, if you find one it will not worker with all numbers. So the only way to simulate a way of finding primes is to take away every multiple of 2 3 5 7 And you will be left with only primes.
Well it's always easy to find a trivial pattern in a sequence of numbers described with finitely many terms (if you disagree, look a few pages back at how I find a valid but wrong pattern in fladdermasken's sequence), and this includes finitely many prime terms. Otherwise, I don't know enough about number theory to say anything else, but I'm pretty sure that there are other ways of finding primes.
 
Last edited:
I'm sure there's some sort of sequence in the occurrence of prime number types
If not, then this thread should be about Quanta >:D


edit
So the only way to simulate a way of finding primes is to take away every multiple of 2 3 5 7 And you will be left with only primes.
I considered that, but unfortunately, it won't work for numbers like 529 :p (not divisible by 2,3,5 or 7, but divisible by 23)
The actual solution (close to yours) is to take make a list of prime numbers up to the square root of the given value (strictly less)then see
if that number is divisible by any of the listed prime numbers.

edit
I just used the above algorithm in WC3 :D
It continued up to 2500000 and hit the op limit (Much better than my previos algorithm that hit the op limit at 5081 lol)
 
Level 17
Joined
Apr 3, 2010
Messages
1,101
Except that's wrong.
(1 - Ans)² - Ans² = (1² - 2Ans + Ans²) - Ans² = 1 - 2Ans
Given the expression you've written, I've found that it cannot loop.

It does loop and if you dont believe me put the exact equasion in your calculator --- I think your problem is that it doesnt equate to 1-2ans
its
(1-Ans)²-Ans²=-1 For we assume ans= 0²-1²=-1 There is no possible way of changing this. If you tried to change it to 1-2ans+ans² that would =1-2+1=0
There for it cannot be (1-Ans)²-ans² =(1² -2ans +ans²)
And i'm having trouble to see how you got to that conclusion.

Another example i have shown with ans = 2 already
(1-ans)²-ans²= (1-2)²-2²= (-1)²-2²=-1-4=-5
IF it was 1-2ans+ans² then that would be 1-4+2²=1 Again that would be wrong.

Im not asking you to simplify it but to understand how it works.
And why it loops.
Note you should use a calculator to do this formulai As i stated this is a Calculator question


Well it's always easy to find a trivial pattern in a sequence of numbers described with finitely many terms (if you disagree, look a few pages back at how I find a valid but wrong pattern in fladdermasken's sequence), and this includes finitely many prime terms. Otherwise, I don't know enough about number theory to say anything else, but I'm pretty sure that there are other ways of finding primes.

Thats why i said *IT wont work for all numbers* i guess i kinda said it not understandably :p there are ways like 3n-1 which gives alot of primes but it doesnt work for all prime numbers. That is why modern day scripts just find numbers not divisible instead of formulai. They use just calculate it.

But yeh nvm Sorry for the misunderstanding
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
Ofcourse I'm interested :D
Currently, I'm writing tons of Math-Oriented scripts (Fractions, Expressions, etc...)

well that's nice to hear :D

this is not the fastest code but it is a pretty good compression for roughly 170 MB of prime numbers
Code:
#include <stdio.h>
#include <stdlib.h>

int main(){
    int i, j, k, n = 0xFFFFFF;
    char *divisible = (char*)calloc(n, 1);
    for (i=3; i<n; i+=2) for (j=2; (k=i*j)<n; j++) divisible[k] = 1;
    for (i=3; i<n; i++) if (!divisible[i]) printf("%i\n", i);
    return 0;
}
if you want to go for higher numbers you will have to replace "int" with a bigger data type like unsigned int, long, unsigned long, __int64 and so on but that will make the code slower because longer data types take longer to be calculated
this will run out of ram fast so a class to store stuff in bits instead of bytes would be recommended
of course one could also skip all numbers with 0, 2, 4, 5 and 8 as the last digit (doing this in hex numbers is way faster because one can skip the %10 part)
and for more speed and less memory there is a method called "Sieve of Atkin"
there also are some very fast ways to check if a number like 2^n-1 is a prime
refer to wikipedia for this
 
I've heard of all those algorithms :)
(2^n)-1 isn't that reliable though :p

I tried the code, it's not THAT slow :D
It took only 30 seconds to generate primes up to 10,000,000 :D (about 1 minute for the entire process before it reached 0xFFFFFF)

@D4RK_G4ND4LF
I found some bugs in that code :p
I tested it with lower values to make it's doing job right, and it did everything perfectly (including all prime numbers), but it doesn't filter out perfect powers of 2 :p
Try it with n = 0xFF

edit

Here:
A quick fix to that code:
Code:
#include <stdio.h>
#include <stdlib.h>

int main(){
    int i, j, k, n = 0xFFFFFF;
    char *divisible = (char*)calloc(n, 1);

    for (i=3; i<n; i+=2)
	{
		for (j=2; (k=i*j)<n; j++)	{ divisible[k] = 1; }
		for (k=2; k<n; k*=2)		{ divisible[k] = 1; }
	}

    for (i=3; i<n; i++)				{ if (!divisible[i]) { printf("%i\n", i); } }

    return 0;
}
 
Last edited:
Level 19
Joined
Feb 4, 2009
Messages
1,313
oops
of course it should be
Code:
#include <stdio.h>
#include <stdlib.h>

int main(){
    int i, j, k, n = 0xFF;
    char *divisible = (char*)calloc(n, 1);
    for (i=3; i<n; i+=2) for (j=2; (k=i*j)<n; j++) divisible[k] = 1;
    for (i=3; i<n; i+=2) if (!divisible[i]) printf("%i\n", i);
    return 0;
}
(i+=2 instead of i++ in the last line since it is clear that only odd numbers can be primes)

Oh, it hurts my eyes to see loops on a single line!

:wink: Ka-wink :wink:

Carry on.

well...I was programming on a 15" laptop for some time and since I am very lazy I wrote short code so I did not have to scroll all the time
 
Level 7
Joined
May 13, 2011
Messages
310
Ah, I see.
It's just that I always write multi-line blocks of code with everything, even small bits, so it's kinda strange to see. But I understand :thumbs_up:
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
Here is a problem that has been bugging me for a very long time. I owe a googol of cookies to whoever gets this.

Show that, for any regular n-gon inscribed in a circle of radius 1, the product of the distances from one vertex to all other vertices is n.

e.g. For an equilateral triangle inscribed in a circle of radius 1.
wanda2.1.gif

mCP = 1, ∠PCM = π/3
so, mPM = sqrt(3)/2, so mPQ = mQR = mRP = sqrt(3)
Then, the problem states that mPQ*mPR = mQP*mQR = mRP*mRQ = sqrt(3)*sqrt(3) = 3, which is true.

e.g. For a square inscribed in a circle of radius 1.
4c2_43439_md.gif

The circle has radius 1, so the square has diagonal 2, so the square has sides of length sqrt(2). Then, the problem states that sqrt(2)*2*sqrt(2) = 4, which is true.

etc.
 
Last edited:
Status
Not open for further replies.
Top