<![CDATA[Math Is Fun Forum / Computer Math]]> 2023-02-05T09:34:08Z FluxBB https://www.mathisfunforum.com/index.php <![CDATA[Brute force for diophantine equation]]> Yes why not if you would like to find out a solution to the following equation
2x³+6xy²-114=z³
Use Mathway to solve it
Thanks me later

]]>
https://www.mathisfunforum.com/profile.php?id=243804 2023-02-05T09:34:08Z https://www.mathisfunforum.com/viewtopic.php?id=25999&action=new
<![CDATA[Interesting Software Tools for Computer Math]]> Today 666bro sent me an email asking

666bro wrote:

I'm intended to learn mathematical softwares especially open source one which is the good one to start with?

Here is what I wrote back:

Here are some tools you could try learning. They are related to mathematics but they are very very different things.

(1) R for statistics: This is a useful tool for making plots and graphs for your data.
(2) Sage for computer algebra: This is a swiss army knife tool - equivalent to mathematica. Tutorial should give you some idea of what you can do with it.
(3) Lean for verified proofs: In Lean, you can write the proof of a theorem and get the computer to check that your proof is correct. Check out Learning Lean and especially the "Natural Numbers Game".
(4) Z3: Z3 is a general purpose reasoning tool that can be used to solve puzzles or check large scale formulas written in a certain language. Tutorial

]]>
https://www.mathisfunforum.com/profile.php?id=95904 2023-01-25T23:43:29Z https://www.mathisfunforum.com/viewtopic.php?id=28848&action=new
<![CDATA[Very good approximation of pi by rational number]]> Hi Keckman,

Keckman wrote:

There is six number in divide operation and you get seven right numbers of pi. But is there even better ones? I guess there is not same kind rational number under one trillion.

Well, according to my research, there's a very big jump from your 355/113 to the next one (103993/33102): your Pascal program might be quite busy for a while. I initially thought of trying brute force like you did, but changed my mind after I googled 'oeis pi fractions approximations 22/7 355/113 104348/33215' (as a single-line search using your fraction, imcute's and the 22/7 I know)...which introduced me to a minefield of info about this topic!

I started here: OEIS (sequence of convergents to Pi): A002485 (numerators) & A002486 (denominators).

Those two links (and a StackExchange post) quoted the following Mathematica formula for obtaining a sequence of increasingly accurate fraction approximations: Convergents[Pi, x].

That interested me as I have Mathematica. I chose 10 for x (for an output of a sequence of 10 fractions) and ran the code in my program and also online at WolframAlpha, with the following output in both:
3, 22/7, 333/106, 355/113, 103993/33102, 104348/33215, 208341/66317, 312689/99532, 833719/265381, 1146408/364913.

The 2nd fraction in the sequence shows the well-known 22/7, the 4th is yours from post #1, and the 6th is imcute's from post #2.

Links to a couple of other sites I looked at:
Wikipedia: Continued fraction expansion of π and its convergents.

Wolfram MathWorld: Pi Continued Fraction.

]]>
https://www.mathisfunforum.com/profile.php?id=40741 2022-12-15T15:24:51Z https://www.mathisfunforum.com/viewtopic.php?id=28560&action=new
<![CDATA[Hypothetical question: what year do humans populate the universe?]]> Wild assumptions:
In one Universe there are 500 billion galaxies, each of which has 200 billion stars, of which every tenth has a planet that can be quite easily modified into a suitable place for humans to live, and the planet can hold an average of 10 billion people. At the moment, there is only one planet called Earth with life in that Universe.

Let's assume that the human population grows on average at the same rate as it has grown since 1700, when we were 640 million 35 thousand 774 about.

In this picture, the red curve describes when the number of people has multiplied by 1.0076 every year. The black curve is obtained based on actual values. That is, because that red curve "clicks" quite well with the real curve, the coefficient 1.0076 is used Question:
In what year do man populate the Universe, after which that 1.0076 multiplication per year must be adjusted to 1.0000 multiplication? The math problem  assumes, of course, that space travel is under control, and we can travel to distant stars and galaxies. This is a mathematical exercise and not a model of the real situation, as we currently have no way to travel to other stars and galaxies.

Solution: I don't know how to use logarithm calculation formulas now, but I solve the problem with a computer program: (maybe someone show me how this is done with logarithm?)

``````rebol[]
g: 5E+11 ;How Many galaxies?
g: (g * 2E+11) / 10 ;How many planets to populate
g: g * 1E+10 ; How many people there can be in Universe?
population: 640035774
year: 1700
until [
print [year " " population]
population: population * 1.0076
year: year + 1
population >= g
]
halt``````

Output:
1700   640035774
1701   644900045.8824
1702   649801286.231106
1703   654739776.006463
1704   659715798.304112
1705   664729638.371223
1706   669781583.622844
1707   674871923.658378
1708   680000950.278182
1709   685168957.500296
.
.
.
8743   9.2194892244472E+31
8744   9.289557342553E+31
8745   9.36015797835641E+31
8746   9.43129517899192E+31
8747   9.50297302235226E+31
8748   9.57519561732213E+31
8749   9.64796710401378E+31
8750   9.72129165400429E+31
8751   9.79517347057472E+31
8752   9.86961678895109E+31
8753   9.94462587654712E+31
>>

The answer is the year 8753. So pretty soon the entire universe will be populated! Right? Yes, exponential population growth is wild!

]]>
https://www.mathisfunforum.com/profile.php?id=243072 2022-12-13T23:48:11Z https://www.mathisfunforum.com/viewtopic.php?id=28562&action=new
<![CDATA[A very inefficient way of approximating the golden ratio]]> Thanks,

I don't know what it is.
It happens too when y approaches 4/3. Sequences get very long.
So for y= 1.3333333 and x= 1 to 999, it found a sequence of length 23,671 at x = 981.
There are 9,799 more odd numbers than even numbers in this sequence.
Some values of y do better than others.
Thanks for the reply though, I was just experimenting, hoping to discover something.
Not easy for me to figure it out. But I had some fun.

]]>
https://www.mathisfunforum.com/profile.php?id=223423 2022-11-15T14:31:44Z https://www.mathisfunforum.com/viewtopic.php?id=28309&action=new
there are 256 possible 3i1o truth tables
(null,a,b,ab,c,ac,bc,abc)
(insert 0~255 translated into binary,i dont want to paste this long sequence here)
fisrt remove not pairs
00000000means that a b c are irrelavent
00001111means that a,b are irrelavent
01010101means that b,c are irrelavent
00110011means that a,c are irrelavent
if 1357/2468 are identical,a is irrelavent
if 1245/3487 are identical,b is irrelavent
if 1234/5678 are identical,c is irrelavent
if 2/3 or 6/7 swap,they are ab symmetry pairs
if 2/5 or 4/7 swap,they are ac symmetry pairs
if 3/5 or 4/6 swap,they are bc symmetry pairs
the rest are elementary but maybe uninteresting gates
(the majority of them are include gates projected to each of the 3 axis)
00000001,
00010000,00010010,00010011,00010101,00010110,00010111,
00100000,00100001,00101110,
00110000,00110001,00110010,00110101,00110110,00110111,
01100000,01100001,01101000,01101001,01101110,01101111,
01110000,01110001,01110010,01110011,01110110,01111000,01111001,01111010,01111011,01111110,01111111,

]]>
https://www.mathisfunforum.com/profile.php?id=241797 2022-10-13T03:23:19Z https://www.mathisfunforum.com/viewtopic.php?id=28133&action=new
<![CDATA[PARI/GP code for Elliptic functions]]>
``````\\ Jacobi theta functions
theta1(q,z)=theta(q,z)
theta2(q,z)=2*q^(1/4)*suminf(n=0,q^(n*n+n)*cos((2*n+1)*z))
theta3(q,z)=1+2*suminf(n=1,q^n^2*cos(2*n*z))
theta4(q,z)=theta3(-q,z)
\\ Elliptic nome
ellnome(k)=if(k,exp(-Pi*agm(1,sqrt(1-k^2))/agm(1,k)),0)
\\ Neville theta functions
thetaS(k,z)=if(k,my(m=k^2,a=agm(1,sqrt(1-m)),q=exp(-Pi*a/agm(1,k)));theta1(q,z*a)*sqrt(a)*m^(-1/4)*(1-m)^(-1/4),sin(z))
thetaC(k,z)=if(k,my(m=k^2,a=agm(1,sqrt(1-m)),q=exp(-Pi*a/agm(1,k)));theta2(q,z*a)*sqrt(a)*m^(-1/4),cos(z))
thetaN(k,z)=if(k,my(m=k^2,a=agm(1,sqrt(1-m)),q=exp(-Pi*a/agm(1,k)));theta4(q,z*a)*sqrt(a)*(1-m)^(-1/4),1.)
\\ Jacobi elliptic functions
jacobiSN(k,z)=thetaS(k,z)/thetaN(k,z)
jacobiCN(k,z)=thetaC(k,z)/thetaN(k,z)
jacobiZN(k,z)=((z)->thetaN(bitprecision(k,getlocalbitprec()),z))'(z)/thetaN(k,z)
jacobiEpsilon(k,z)=jacobiZN(k,z)+z*ellE(k)/ellK(k)
jacobiAM(k,z)=if(k,-I*log((thetaC(k,z)+I*thetaS(k,z))/thetaN(k,z)),z)
\\ Alternative implementations
jacobiSN(k,z)=if(k==0,return(sin(z)),k^2==1,return(tanh(z)));my(a=ellK(k),b=I*ellK(sqrt(1-k^2)),w=[4*a,2*b],p);p=iferr(ellwp(w,z,1),E,return(0),errname(E)=="e_DOMAIN");-2*(p-ellwp(w,2*a))/p
jacobiCN(k,z)=if(k==0,return(cos(z)),k^2==1,return(1/cosh(z)));my(a=ellK(k),b=I*ellK(sqrt(1-k^2)),w=[4*a,2*(a+b)],p);p=iferr(ellwp(w,z),E,return(1),errname(E)=="e_DOMAIN");(p-ellwp(w,a))/(p-ellwp(w,b))
jacobiDN(k,z)=if(k==0,return(1.),k^2==1,return(1/cosh(z)));my(a=ellK(k),b=I*ellK(sqrt(1-k^2)),w=[2*a,4*b],p);p=iferr(ellwp(w,z),E,return(1),errname(E)=="e_DOMAIN");(p-ellwp(w,a+b))/(p-ellwp(w,b))
jacobiZN(k,z)=if(k==0,return(0.),k^2==1,return(tanh(z)));my(a=ellK(k),b=I*ellK(sqrt(1-k^2)),w=[2*a,2*b]);ellzeta(w,z+b)-ellzeta(w,b)-ellzeta(w,a)/a*z
jacobiEpsilon(k,z)=if(k==0,return(z),k^2==1,return(tanh(z)));my(a=ellK(k),b=I*ellK(sqrt(1-k^2)),w=[2*a,2*b]);ellzeta(w,z+b)-ellzeta(w,b)+z*(2-k^2)/3
\\ Incomplete elliptic integrals
incellF(k,phi)=my(s=sin(phi),c=1-cos(phi),d=1+sqrt(1-(k*s)^2),E=ellinit(-[(1-k^2+k^4)/3,(2-3*k^2-3*k^4+2*k^6)/27]));2*ellpointtoz(E,[d/c-(1+k^2)/3,s*(k^2*c-d)/c^2])
incellE(k,phi)=jacobiEpsilon(k,incellF(k,phi))
\\ Lemniscatic elliptic functions
sinlemn(z)=my(p);iferr(p=ellwp(ellinit([1/4,0]),z,1),E,return(0.),errname(E)=="e_DOMAIN");-2*p/p
coslemn(z)=my(p);iferr(p=ellwp(ellinit([1/4,0]),z),E,return(1.),errname(E)=="e_DOMAIN");(2*p-1)/(2*p+1)
asinlemn(z)=z*hypergeom([1/4,1/2],5/4,z^4)
acoslemn(z)=ellK(I)-asinlemn(z)``````
]]>
https://www.mathisfunforum.com/profile.php?id=239728 2022-08-31T01:53:34Z https://www.mathisfunforum.com/viewtopic.php?id=27922&action=new
<![CDATA[2-dimensional integral involving Bessel functions]]> Formulas are an integral part of Mathematics. An easy way out is start learning the simple formulas initially.

For example, see these formulas:

Sphere, Cone, and Cylinder.

]]>
https://www.mathisfunforum.com/profile.php?id=682 2022-04-12T04:41:16Z https://www.mathisfunforum.com/viewtopic.php?id=23509&action=new
<![CDATA[Maths to work out movement of racing cars rear suspension]]> Looking at photo u provided. The radius arms are in silver paint and the side shafts in blue paint coming out from gearbox. What happens in bump is wheels go up and wheel moves in an arch. The gearbox pivot point is 100 mm from centre of gearbox either side of centre line. The suspension does not move that much total travel of single shock/spring is about 35 mm.

]]>
https://www.mathisfunforum.com/profile.php?id=237308 2021-08-12T19:57:26Z https://www.mathisfunforum.com/viewtopic.php?id=26502&action=new
<![CDATA[Why float number is not as accurate as human thinks and the solution~]]> It would be interesting to read in an accessible form how mathematical operations are performed with float numbers in this form and how you can efficiently convert a number from an ordinary string to a float.

]]>
https://www.mathisfunforum.com/profile.php?id=237376 2021-08-12T12:07:02Z https://www.mathisfunforum.com/viewtopic.php?id=25054&action=new
<![CDATA[Project Euler]]> I joined and added you! I am still with the same username, jabah013.307

]]>
https://www.mathisfunforum.com/profile.php?id=237121 2021-08-05T12:48:20Z https://www.mathisfunforum.com/viewtopic.php?id=26074&action=new
<![CDATA[Fun math problem]]> Cool. Glad you think so.
I had similar results. The most I've found was 75 steps for 830612 towards 13682.
This time, I removed 0 when it came in front.
This was simpler to implement. I see that you have stopped when you'd loose a digit. Seems cool too.
I have the same result for 103682. It takes 74 steps.

Not sure you would post it to OEIS? All fine by me.

]]>
https://www.mathisfunforum.com/profile.php?id=223423 2021-01-05T19:54:57Z https://www.mathisfunforum.com/viewtopic.php?id=25955&action=new
<![CDATA[Programming vs algorithm]]> 666 bro wrote:

How programming is different from algorithms?

pi_cubed wrote:

Hi 666 bro,

In programming we say that we "implement algorithims" into programs, which gives us the idea that they are different. An algorithim is simply a thought process. Programming is implementing the algorithim, or writing it in a language that the interpeter can understand.  Think of the programmer as an inventer. The idea for the invention is the algorithim. The invention is the code. Hope this clears things up.

*Sorry for some misspellings*

]]>
https://www.mathisfunforum.com/profile.php?id=222180 2020-07-02T13:25:45Z https://www.mathisfunforum.com/viewtopic.php?id=25724&action=new
<![CDATA[To what extent is mathematics needed for computer science or software]]> Seems like I missed this thread.

Why do you think eliminating mathematics is a good idea?

]]>
https://www.mathisfunforum.com/profile.php?id=95904 2020-04-19T03:59:58Z https://www.mathisfunforum.com/viewtopic.php?id=25571&action=new
<![CDATA[Software Solution 2019 Latest Updates]]> hi stupidblogger

New members are welcome but, if you had read my post carefully, you would realise that yours is close to unacceptable too.  Please read this:

http://www.mathisfunforum.com/misc.php?action=rules

Bob

]]>
https://www.mathisfunforum.com/profile.php?id=67694 2019-06-12T09:15:21Z https://www.mathisfunforum.com/viewtopic.php?id=24619&action=new