@@PapaFlammy69 I'm 16 and I'm really interested in math and learning python. Do you think I should attempt to learn this if I have barely any knowledge on python.
YES! More dividorial vídeos. I still can't wrap my head around how awesome the notation for the dividorial is. Every time I think of the upside down exclamation I laugh.
Hey! I'd recommend using the Decimal class for longer decimals! Also python can handle converting to floating point automatically. the range in the for loop can specify an iteration, so "for i in range(x,1,-2): temp *= i" would solve the double factorial You can also slip expressions directly into the return statement! Some of the code that I wrote; def factorial( x, degree = 1 ): temp = 1 for i in range( x, 1, -degree ): temp *= i return temp def dividorial( x ): return float( factorial( x, 2 ) / factorial( x - 1, 2 ) ) You might be interested in Spyder, software included in the Anaconda package that comes with interesting packages built in for python data science. I am very impressed by how this converges to pi/2, this is incredible! I really enjoy your videos and look forward to more videos like this! :D
@@PapaFlammy69 Oh, and I apologize. I was mistaken for thinking pi/2 was Tau. Tau is actually 2pi, but I'm sure you already know that haha. Anyways, you might be interested to know Python has a built in complex number datatype. I used it to generate the fractal in my pfp lol.
@@fractal_lynn i thought that was just a zoomed in screenshot of the mandelbrot set. but yeah, i dont think the mandelbrot set looks like that, at least not exactly.
@@paulthiede Its a warped version of the mandelbrot set zoomed in to a specific spot; i.imgur.com/LmK5kow.png Also heres strictly the mandelbrot set with 1024 iterations per pixel; (7200x5400) i.imgur.com/l7JFxrH.png
Since an integer is either odd or even, you can simply right : if x%2 == 0 : ... else : ... Your video was really cool I like the addition of programming in it :) ! Keep it up
you can also do just: if x%2: ... else: ... but much cleaner solution was suggested for double factorial, that avoids cases altogether: df = 1 for i in range(x, 1, -2): df *= i return df
There exists an integral representation of 1/dividorial through n!!/(n-1)!!= Integral from 0 to pi/2 of sin(x)^n dx (*2/pi if n is even). So you can conclude that 1/divdorial=Integral from 0 to pi/2 sin(x)^n/((3*pi/4)+pi/4*(-1)^(n+1)) dx. WolframAlpha then gives an even better formular for dividorial with some transformations: www.wolframalpha.com/input/?i=1%2F%28%283*pi%2F4%29%2Bpi%2F4*%28-1%29%5E%28n%2B1%29%29+sin%28x%29%5En+dx+from+0+to+pi%2F2
Arjun Vyavaharkar I am not a fan of the fact that you defined a shifted version instead of simply defining an extension of the original. It is needlessly cumbersome.
Arjun Vyavaharkar *Use it or lose it* Nobody is going to be using such an arbitrary formula of an arbitrarily named function that doesn't really show up in applications. Also, I guess you're too damn immature to accept constructive criticism. It's not my fault you're so hopelessly arrogant.
thanks for the python stuff. Since you, Lex Fridman & Andrew Dotson & 3B1B have some shared interest, I am surely not the only one hoping you all bro it out
Using modulus two inside some of the loops can make for some much faster and nicer branchless coding. This would help if you were to try very large values of n.
You didn't have to split it up into odd and even cases. You can just do: def dfac(x): df = 1 for i in range(x, 1, -2): df *= i return df This loops through the range from x to 1 and subtracts 2 for each iteration.
Also, here are some relatively simple formulae that extend the dividorial to complex arguments via analytic continuation. z¡ = 1/sqrt(2)·(z/2)!/[(z - 1)/2!]·sqrt(π/2)^[cos(πz)/2] z¡ = 1/sqrt(2π)·2^z·sqrt(π/2)^[cos(πz)/4]·(z/2)!^2/z! z¡ = 1/sqrt(2π)·exp[ln(2)·z + ln(π/2)/4·cos(πz)]·Π(z/2)^2/Π(z) The second formula removes the quotient of difference from the first, just in case that this is preferrable, and expresses the dividorial more directly in terms of the factorial, and the third formula addresses notational concerns: namely, it uses the Π notation for complex numbers instead of using the factorial notation, which is, in most rigorous circles, reserved for natural numbers only, and it also addresses the concern that complex exponentiation is technically multivalued, and that the analytic exponential function should be used instead.
This `elif` with the entire test of whether x is odd after we already know it's not even hurts my little programmer heart. At least the cool math makes up for it ;_;
Yeah, but for someone who's not a programmer and only follows the mathematical logic, it makes sense to have a disjunction of cases. Otherwise, just loop from n down to 1 exclusive in steps of 2 and multiply throughout.
This code makes sense because if it's not even, it could be a decimal, in which case it'd make sense to have an else statement and then raise an input error exception, papa just didn't include that part because it's not very relevant to the video.
i mean (ai)² + (bi)² = aiai + bibi = -a² - b² and (ci)² = cici = -c² so -a² - b² = -c² which would be a² + b² = c² | *(-1). So just the pythagorean formular multiplied by -1. But then again its obvious that that would be true if you do the following: a² + b² = c² | *i² a²i² + b²i² = c²i² = (ai)² + (bi)² = (ci)². But because i²= -1 we are looping around with the same expressions. To answer your question, idk if there would be any use to your identity, but I think it would be a funny way of calculating the length of a hypothenuse in the 9th grade. :-)
@@paulthiede I was thinking about the dividorial. It would be very interesting to see if there are any identities with it. Like I dunno, pascals triangle but with dividorials. Or golden ratio in dividorials terms.
Hi Papa FM I have a question. You know how we accelerate summation series with partial sums(like Euler transform(ie van vigngaarden) and Shanks? Are there methods to accelerate this product? Or, would you have to treat the product as a series of repeated sums and then apply acceleration?
Ok so if we want to write the double factorial in terms of factorial, we would get this, right? : n!! = (2*(n/2))(2*(n/2 -1))...*(2*2)(2*1), which then equals to (n/2)!*2^(n/2) For even n's, right?
Clashgamer04 if it was according to my assumption, for n=6 it would be: (2*(6/2))(2*(6/2 -1))(2*(6/2 -2))=(2*3)(2*2)(2*1), which is the thing PapaFlammy wrote as well. With your assumption it would be: (2*(6/2))(2*(6/2)-1)(2*(6/2)-2 = 2*3*2*5*2*4 PapaFlammy already wrote (2*(n/2 - 1)) out to (2*n/2 -2)
Lol 4:05 what is wafu do u mean wife?? 🤣🤣🤣🤣😂😂 I think dividorial is pi's boyfriend and pi is dividorial's girlfriend what a beautiful relationship 😍😻💟 And u pronounce 5 like FAF just like y as whayy(inspiriert von Ozarks bester Netflix-Serie) And u pronounce pi over 2 like paaaye over two ("""")
I think he meant the plot of sin(x¡) and cos(x¡). But honestly, there are no "good" continuous representations of the double factorial... let alone the dividorial. And no, I'm not counting that one strange continuous representation that Wikipedia uses for the double factorial. It hardly makes any sense to use, given the context.
What I find neat about this is the fact that you unknowingly found a zeroth order asymptotic expansion for the dividorial. lim (2n)¡^2/(2n + 1) = π/2 implies lim (2n)¡/sqrt(2n + 1) = sqrt(π)/sqrt(2). sqrt(2n + 1) = sqrt(2)·sqrt(n + 1/2), so lim (2n)¡/sqrt(n + 1/2) = sqrt(π). Incidentally, this implies that lim (2n)¡/sqrt(n + 1/2) = (-1/2)!, so there is another cool connection between the dividorial and the factorial. Anyhow, the point I am making is that (2n)¡ ~ sqrt(π)·sqrt(n + 1/2), or equivalently, (2n)¡ = O(sqrt(n + 1/2)). This is useful because it gives you an understanding of growth that is now useful for calculating many other limits.
May I make a suggestion to just slow down your speech just a little bit. Actually, you don't need to slow down, but you should take a breath between sentences, lol.
I think a better name of the dividorial would be fictorial, short for fiction-orial, get it, fact-orial, fiction-orial cuz the dividorial is kind of made up ok imma leave
Randy ? is already used for the termial, the addition version of the factorial. The function is introduced by Donald Knuth in 1997. Example: 5? = 1 + 2 + 3 + 4 + 5 5? = 15 In general: n? = n(n+1)/2
Hey you! Thanks for watching ! :D If you like what you saw, please share the video around :3 Love ya
You forgot to add the program in the description.
@@integralboi2900 Damn, thank you! It's been fixed now! =)
@@PapaFlammy69 I'm 16 and I'm really interested in math and learning python. Do you think I should attempt to learn this if I have barely any knowledge on python.
@@MidnightStorm4990 yes start learning
Introducing python coding and combining it with the maths on the board sounds good, I would love more of that. :)
Mee too
Definitely more to come soon! :) Thank you for your feedback! :)
Exactly my thoughts 👍
Python and n¡?
Sounds like a skit about mathematicians that say n¡.
Hey last year you left your used napkin on my kitchen table. I still have it in case you want it back.
yes, plis.
Ahahaha
Dividorial is one of the silliest sounding terms I’ve ever heard of... but it’s starting to grow on me.
Same! :DDD
Just looking at the word has me going crazy pronouncing it.
I'm divided on the subject, but it's a factor, and that can I double down on.
Woah that escalated quickly...
Or did it?
@@aasyjepale5210 exponentially or linearly?
YES! More dividorial vídeos. I still can't wrap my head around how awesome the notation for the dividorial is. Every time I think of the upside down exclamation I laugh.
same
¿Qué quieres decir con eso? ¡Eso no es divertido!
Papa Flammy's Math video with Python programming.........it's worth more than gold. #pymath
Python? It thought this was a maths channel.
Just kidding, these videos are interesting.
=D
I've followed you for a few years now and this is one of my favourite videos you've made :))
Hey! I'd recommend using the Decimal class for longer decimals!
Also python can handle converting to floating point automatically.
the range in the for loop can specify an iteration, so "for i in range(x,1,-2): temp *= i" would solve the double factorial
You can also slip expressions directly into the return statement!
Some of the code that I wrote;
def factorial( x, degree = 1 ):
temp = 1
for i in range( x, 1, -degree ): temp *= i
return temp
def dividorial( x ): return float( factorial( x, 2 ) / factorial( x - 1, 2 ) )
You might be interested in Spyder, software included in the Anaconda package that comes with interesting packages built in for python data science.
I am very impressed by how this converges to pi/2, this is incredible!
I really enjoy your videos and look forward to more videos like this! :D
Thank you for the python bits and the information!!! :)
@@PapaFlammy69 Oh, and I apologize. I was mistaken for thinking pi/2 was Tau. Tau is actually 2pi, but I'm sure you already know that haha.
Anyways, you might be interested to know Python has a built in complex number datatype. I used it to generate the fractal in my pfp lol.
@@fractal_lynn i thought that was just a zoomed in screenshot of the mandelbrot set. but yeah, i dont think the mandelbrot set looks like that, at least not exactly.
@@paulthiede Its a warped version of the mandelbrot set zoomed in to a specific spot; i.imgur.com/LmK5kow.png
Also heres strictly the mandelbrot set with 1024 iterations per pixel; (7200x5400) i.imgur.com/l7JFxrH.png
@@fractal_lynn There is math.factorial().
I really liked the python part. I’m learning programming myself and this really helps understand math concepts in programming. Thanks Jens 😉
Nice :3
This video was incredibly interesting and incredibly fun to watch! Looking forward to more of this soon!
Thank you! =)
Seeing your video, one might mistakenly think that the limit notation was invented in the middle east.
:'D
Al-Cauchy
Since an integer is either odd or even, you can simply right :
if x%2 == 0 :
...
else :
...
Your video was really cool I like the addition of programming in it :) ! Keep it up
you can also do just:
if x%2:
...
else:
...
but much cleaner solution was suggested for double factorial, that avoids cases altogether:
df = 1
for i in range(x, 1, -2):
df *= i
return df
Is there a way to write the dividorial as an integral formula just like the gamma- or pi function for the factorial?
haven't found one yet sadly :3
There exists an integral representation of 1/dividorial through n!!/(n-1)!!= Integral from 0 to pi/2 of sin(x)^n dx (*2/pi if n is even).
So you can conclude that 1/divdorial=Integral from 0 to pi/2 sin(x)^n/((3*pi/4)+pi/4*(-1)^(n+1)) dx.
WolframAlpha then gives an even better formular for dividorial with some transformations:
www.wolframalpha.com/input/?i=1%2F%28%283*pi%2F4%29%2Bpi%2F4*%28-1%29%5E%28n%2B1%29%29+sin%28x%29%5En+dx+from+0+to+pi%2F2
Arjun Vyavaharkar I am not a fan of the fact that you defined a shifted version instead of simply defining an extension of the original. It is needlessly cumbersome.
Arjun Vyavaharkar *Use it or lose it*
Nobody is going to be using such an arbitrary formula of an arbitrarily named function that doesn't really show up in applications. Also, I guess you're too damn immature to accept constructive criticism. It's not my fault you're so hopelessly arrogant.
Arjun Vyavaharkar *I don't care about what you think*
And I don't care that you don't care. Grow up, kid.
12:00 I might be wrong but I'm pretty sure implications don't work like that
0:44 On the one hand, Pi. On the other hand, Py.
thanks for the python stuff. Since you, Lex Fridman & Andrew Dotson & 3B1B have some shared interest, I am surely not the only one hoping you all bro it out
I LOVE this new format it is amazing!! Thanks papa
I like the math + python format, it's nice
Also, well made video, damn :D
Love python being introduced to the channel!!
Or just import scipy, which has a "factorial2" function that calculates the double factorial for you.
lel
Why didn't you just made a loop from n to 1 with step -2 in dfac(x), it would be just df *= i and you wouldn't have to consider 2 cases
I've decided to call n!/(n-1)! the unfactorial
Using modulus two inside some of the loops can make for some much faster and nicer branchless coding. This would help if you were to try very large values of n.
Love the python/coding bits! More!
so 1/dividorial looks a bit like the integral of sin^n(x) or cos^n(x) from 0 to pi/2 just looking at the wikipedia page for double factorials.
You didn't have to split it up into odd and even cases. You can just do:
def dfac(x):
df = 1
for i in range(x, 1, -2):
df *= i
return df
This loops through the range from x to 1 and subtracts 2 for each iteration.
That is nice, I didn't know about that, thank you! :)
@@PapaFlammy69 No papa. Just do:
def dfac(x):
return prod(range(x,1,-2))
"prod" is the product of all elements in a list, no need to write loops :(
no need to loop. Use "prod"
papa flammy are you gonna invent fractional rank tensors and fractional dimensional calculus in the next upload?
The CIAO at the end is poetry for my italian ears
Also, here are some relatively simple formulae that extend the dividorial to complex arguments via analytic continuation.
z¡ = 1/sqrt(2)·(z/2)!/[(z - 1)/2!]·sqrt(π/2)^[cos(πz)/2]
z¡ = 1/sqrt(2π)·2^z·sqrt(π/2)^[cos(πz)/4]·(z/2)!^2/z!
z¡ = 1/sqrt(2π)·exp[ln(2)·z + ln(π/2)/4·cos(πz)]·Π(z/2)^2/Π(z)
The second formula removes the quotient of difference from the first, just in case that this is preferrable, and expresses the dividorial more directly in terms of the factorial, and the third formula addresses notational concerns: namely, it uses the Π notation for complex numbers instead of using the factorial notation, which is, in most rigorous circles, reserved for natural numbers only, and it also addresses the concern that complex exponentiation is technically multivalued, and that the analytic exponential function should be used instead.
But what are their applications?
where do you buy a chalkboard
This `elif` with the entire test of whether x is odd after we already know it's not even hurts my little programmer heart. At least the cool math makes up for it ;_;
yeah, he could just have made an else. I noticed that as well and I dont understand it too.
He didn't even have to consider 2 cases and just made loop with step 2
Yeah, but for someone who's not a programmer and only follows the mathematical logic, it makes sense to have a disjunction of cases. Otherwise, just loop from n down to 1 exclusive in steps of 2 and multiply throughout.
This code makes sense because if it's not even, it could be a decimal, in which case it'd make sense to have an else statement and then raise an input error exception, papa just didn't include that part because it's not very relevant to the video.
@@Daniel-nl3ug you're right! i didnt think of that
At 7:48 is that a sin or a k or a h?
Yes
Bruh my math degree is killing me and then I watch more math to unwind
What am I even? Lol
bruhv
In the seco d Python program you can implement the code into a Github repository and I like This implementation
Is
(ai)^2+(bi)^2=(ci)^2
Or any sutch identity?
i mean
(ai)² + (bi)² = aiai + bibi = -a² - b²
and
(ci)² = cici = -c² so -a² - b² = -c²
which would be
a² + b² = c² | *(-1).
So just the pythagorean formular multiplied by -1.
But then again its obvious that that would be true if you do the following:
a² + b² = c² | *i²
a²i² + b²i² = c²i² = (ai)² + (bi)² = (ci)².
But because i²= -1 we are looping around with the same expressions.
To answer your question,
idk if there would be any use to your identity,
but I think it would be a funny way of calculating the length of a hypothenuse in the 9th grade. :-)
@@paulthiede I was thinking about the dividorial. It would be very interesting to see if there are any identities with it.
Like I dunno, pascals triangle but with dividorials.
Or golden ratio in dividorials terms.
Hi Papa FM I have a question. You know how we accelerate summation series with partial sums(like Euler transform(ie van vigngaarden) and Shanks? Are there methods to accelerate this product? Or, would you have to treat the product as a series of repeated sums and then apply acceleration?
Most likely the latter.
Ok so if we want to write the double factorial in terms of factorial, we would get this, right? :
n!! = (2*(n/2))(2*(n/2 -1))...*(2*2)(2*1), which then equals to (n/2)!*2^(n/2)
For even n's, right?
though im not sure I think you made an error with "2*(n/2-1)" I think it would need to be "2(n/2)-1" in order to be correct
Clashgamer04 if it was according to my assumption, for n=6 it would be:
(2*(6/2))(2*(6/2 -1))(2*(6/2 -2))=(2*3)(2*2)(2*1), which is the thing PapaFlammy wrote as well.
With your assumption it would be: (2*(6/2))(2*(6/2)-1)(2*(6/2)-2 = 2*3*2*5*2*4
PapaFlammy already wrote (2*(n/2 - 1)) out to (2*n/2 -2)
Yes, n!! = 2^(n/2)·(n/2)! for even n is correct indeed.
this was stupid why not just print(math.pi/2) smh my head
;_;
xD
"smh my head"? :D
Shaking my head my head
@@tomkerruish2982 shaking (my head) ^2
that was so... clean!!
Lol 4:05 what is wafu do u mean wife?? 🤣🤣🤣🤣😂😂
I think dividorial is pi's boyfriend and pi is dividorial's girlfriend what a beautiful relationship 😍😻💟
And u pronounce 5 like FAF just like y as whayy(inspiriert von Ozarks bester Netflix-Serie)
And u pronounce pi over 2 like paaaye over two ("""")
Paaayeee over 2 lmao
lmao
Pls do a live Q&A
On my list already! :)
So since we have lim ((2n)¡)^2/(2n+1) -> pi/2, does that mean that we have n¡ ~ n^1/2 ?
I think it would be more accurate to say n¡ = O(n^(1/2))
def double_fac(x):
product = 1
for i in range(x,1,-2):
product = product * i
return product
This would also work as a double factorial
so would:
def double_fack(x):
return prod(range(x,1,-2))
What is the plot of
Sin(xi) or cos(xi)?
Sinh(x) and cosh(x) respectively I'm pretty sure
kinda, yes
I think he meant the plot of sin(x¡) and cos(x¡). But honestly, there are no "good" continuous representations of the double factorial... let alone the dividorial. And no, I'm not counting that one strange continuous representation that Wikipedia uses for the double factorial. It hardly makes any sense to use, given the context.
He back
¡
great format
What I find neat about this is the fact that you unknowingly found a zeroth order asymptotic expansion for the dividorial. lim (2n)¡^2/(2n + 1) = π/2 implies lim (2n)¡/sqrt(2n + 1) = sqrt(π)/sqrt(2). sqrt(2n + 1) = sqrt(2)·sqrt(n + 1/2), so lim (2n)¡/sqrt(n + 1/2) = sqrt(π). Incidentally, this implies that lim (2n)¡/sqrt(n + 1/2) = (-1/2)!, so there is another cool connection between the dividorial and the factorial. Anyhow, the point I am making is that (2n)¡ ~ sqrt(π)·sqrt(n + 1/2), or equivalently, (2n)¡ = O(sqrt(n + 1/2)). This is useful because it gives you an understanding of growth that is now useful for calculating many other limits.
For python, maybe jupyter could be better for video, mixing live execution and cached results.
Math plots could be enlightening!
But what is !i¡!?
nice
The python part is great
Wait but which dividorial definition do you mean here? 🚰
Asking before watching the video
Why would you ask before the watching the video? That is so pointless.
Angel Mendez-Rivera yeah I know, but I like pointless things. Life is pointless as well... And I am 14 and this is deep
Im seriously getting pissed at youtube, i got this recommended but I wasn’t notified..? What..?
I hate it so god damn much :(((
I'm so used to visual studio it felt weird not seeing visual studio
xD
Ok, why didn’t we just multiplied wa*2 to seek for π, not π/2 ? xD
Ayy python
Math goes wild
Still love ya, papa
Poopietorial
pi^2 does not equal g
It does, though
@@angelmendez-rivera351 only to one decimal place
Michael Empeigne Yeah. That's good enough.
do not mix up П and п.
I noticed
Nice
Papa flammy do you have depression ?
wat? Hell no lol
You look like you're having a Vietnam flashback on almost every video
xD
33th!!!
nice xD
Papa answer this question I bet you can’t
What’s 2+2
4 apples
@@PapaFlammy69 oh my
I underestimated your intelligence
indeed my dear son.
@@PapaFlammy69 Dear Papa, I am sorry to inform you that the answer is actually 22 apples
Nice Jojo reference
haha yes
I never liked python syntax (c++/java looks so much better lmao) but this is still some really cool stuff
GENIUS likes to use blackboard not White board....using white board u become dumb cuz keep asking ' Why Board? '
May I make a suggestion to just slow down your speech just a little bit. Actually, you don't need to slow down, but you should take a breath between sentences, lol.
4 views 4 thumbs up, talk about ratio
I am second NGL!
Hello bro love from India,your vedio helps a lot
*laughs in engineering* i havent understood a word you said, but i know that it is useless
is it really that hard? i mean i always though like "why is he explaining that 6/2 =3?"
@@paulthiede oh that is what he was trying to tell in this video, thanks for translating
I think a better name of the dividorial would be fictorial, short for fiction-orial, get it, fact-orial, fiction-orial cuz the dividorial is kind of made up ok imma leave
Do like the number pahhh
Please stop using the upside down ! :d just use a ?
Randy ? is already used for the termial, the addition version of the factorial. The function is introduced by Donald Knuth in 1997.
Example:
5? = 1 + 2 + 3 + 4 + 5
5? = 15
In general:
n? = n(n+1)/2
@@RealLifeKyurem ah I didn't know that, ty
n. is a good option, but so is n, and maybe n;.
Your code sucks papa. You should just:
def dfac(x):
return prod(range(x,1,-2))
I'm disappointed.