Wikipedia:Reference desk/Archives/Computing/2018 January 25

= January 25 =

How to make phpmyadmin accessible only one nonlocalhost computer other than localhost server in network
It says that change settings in xampp to make phpmyadmin available at a particular nonlocalhost ip address i have to edit xampp-httpd.conf file buti can't understand what exact change or any other change /script elsewhere````

Why is it so hard to solve this puzzle in other programming languages?
Why is it so hard to solve this puzzle in other programming languages like basic, C, perl or python?

Here is the puzzle, it is from the url youtu.be/RY7YKSw1t_M

There are 6 apple seeds. Everyday, there is 1/2 chance that each seed will turn into an apple tree. Once a seed turn into an apple tree, it will remain an apple tree forever. What is the expected number of days when all six seeds has finally turn into apple trees.

The answer is 7880/1953 which is calculated using wolfram/mathematica language source code below.

h[0]=0; func[n_]:=Module[ {expr,soln}, expr = h[n] == Sum[Binomial[n, k]*(1/2)^n*(1 + h[n - k]), {k, 0, n}]; soln = Part[ Solve[expr,h[n]], 1  ]; h[n] = h[n] /. soln; h[n] ]; Map[func, {1,2,3,4,5,6} ] With the result {2,8/3,22/7,368/105,2470/651,7880/1953}

How do I write the program above in python? Why is it so difficult to write the program above in any other programming languages? Ohanian (talk) 16:55, 25 January 2018 (UTC)
 * Why do you think it's hard? Hard for whom? HenryFlower 20:43, 25 January 2018 (UTC)
 * Most other languages don't have Binomial, Sum, etc, built in, but they are very easy to implement. Bubba73 You talkin' to me? 00:35, 26 January 2018 (UTC)
 * Mandatory XKCD: . You rarely need to reimplement anything in Python, you just need the adequate package (in this case, Scipy). The base library is small (voluntarily?) but you can import pretty much anything else you need. I would assume there are libraries for Perl and C for the same, though I have not checked it. Tigraan Click here to contact me 20:50, 27 January 2018 (UTC)

I think the clever thing Mathematica is doing is solving the recurrence automatically. The simplest way I saw to do it in Python is explicit recursion:

which prints "7880/1953". 173.228.123.121 (talk) 07:02, 31 January 2018 (UTC)