Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#176 Re: Computer Math » Constraints? » 2014-03-18 02:10:09

gAr

Hi,

We can approximate by simulation (J again):

   a=:3+9*?10000000#0
   b=:4+11*?10000000#0
   >./((10*a)+(25*b))*(20>a+b)

=424.953939391672
which is close to the exact answer of 425.

Brief explanation:
1) Get random uniform values in the range for x and y.
2) Get the maximum of 10x+25y among the values where x+y<=20

From the LPP:

(3 5 12 12 3)([: >./ (10 * [) + 25 * ]) 15 15 8 4 4

= 425

We can easily obtain the tacit definition using

sim=: 13 : '>./((10*x)+(25*y))'

Typing in sim gives the tacit definition. We can then use that output to build more complicated definitions.

#177 Re: Computer Math » A stumper? » 2014-03-17 23:56:29

gAr

Hi,

I think I got a hang of doing things in J.

Here's a simulation for an approximate answer:

sim=: 3 : '0=+/+/(2 4 8 16)=/2+/\(20?20){5#1 2 4 8'
((!20)%(!5)^4)*(+/%#)(sim "0) 1000000#0

= 135712661.692608

#178 Re: Exercises » Bafflers? » 2014-03-12 02:58:17

gAr

Hi,

Yes, the answer's right.

#179 Re: Exercises » Bafflers? » 2014-03-11 20:34:04

gAr

Hi,

A simulation is also close, in J:

a=:4#(i.13)
sim =: 3 : '1=+/(?3#52){a'
(+/%#)(sim"0)1000000#0

≈ 0.001373

#180 Re: Help Me ! » In the following series, find the 2048th number » 2014-03-10 03:44:23

gAr

One way by programming:

In python:

(sum([i*[1]+2*i*[2]+3*i*[3]+4*i*[4] for i in range(1,21)],[]))[2047]

=4

#181 Re: This is Cool » Running Raspbian in QEMU » 2014-03-02 19:42:06

gAr

It has many softwares I probably never use.
Having less processes means higher responsiveness. Boot time also will be reduced.

#182 Re: This is Cool » Running Raspbian in QEMU » 2014-03-02 19:24:44

gAr

Okay, I'll see.
I'm thinking of installing debian, and compile the latest kernel for only the hardware I use.

#183 Re: This is Cool » Running Raspbian in QEMU » 2014-03-02 19:10:20

gAr

No, linux mint.
I'm used to its applets. Do you use LXDE? Can I have multiple panels in that?

#185 Re: Computer Math » Four Squares Reborn » 2014-03-02 00:16:05

gAr

Yes, I was trying a way to use only the formulas for sector and square, could not proceed that way.

#187 Re: Computer Math » Four Squares Reborn » 2014-03-01 19:12:16

gAr

Anybody will, once they realize how compact the code can get!

#188 Re: Computer Math » Four Squares Reborn » 2014-03-01 19:05:25

gAr

Functional programming is very powerful once we get a hang of it.

#189 Re: Computer Math » Four Squares Reborn » 2014-03-01 18:51:27

gAr

Hi,

How do you get the first 100 squares with your favorite language?

In J, it's simple:

(1+i.100)^2

Range[100]^2 in Mm?

#191 Re: This is Cool » Running Raspbian in QEMU » 2014-03-01 05:18:31

gAr

Yes, frontend just like a PC version.

Documentation is not available in it, we have to rely on online docs.

#192 Re: This is Cool » Running Raspbian in QEMU » 2014-03-01 02:53:49

gAr

You're welcome.

Hi Agnishom,

Yes, it includes v10. The zipped file has raspbian image which is 3GB.

#193 Re: This is Cool » Running Raspbian in QEMU » 2014-03-01 02:23:29

gAr

yes, most of the smartphones also have that architecture.

#195 Re: This is Cool » Running Raspbian in QEMU » 2014-03-01 02:08:01

gAr

Yeah, but I think they don't support ARM.

#196 Re: This is Cool » Running Raspbian in QEMU » 2014-03-01 01:55:17

gAr

Yes, I can use it for a few functions like obtaining a gf, which is not yet available in sage.

#197 Re: This is Cool » Running Raspbian in QEMU » 2014-03-01 01:32:46

gAr

Yes, it's version 10, not even out for PC.

#198 Re: Computer Math » Four Squares Reborn » 2014-02-28 18:38:50

gAr
In[8]:= ClearSystemCache[]; Timing[fubar[7777777777];]

Out[8]= {0.499203, Null}

And it took 4.37s in raspbian VM, not bad I think.

#199 Re: Help Me ! » Sum of Fourier series » 2014-02-28 17:55:33

gAr

The answer I linked to is unnecessarily long. We can solve simply by using Maclaurin series for complex numbers:


Use DeMoivre's theorem and equate real and imaginary parts:

Board footer

Powered by FluxBB