Hot answers tagged

11

You can input numbers in any base up to 36 using the notation base^^digits. Digits over 9 are represented using a, b, c, ... You can print numbers in any base up to 36 using BaseForm. Thus, In[1]:= a=2^^0.10101 Out[1]= 0.65625 In[2]:= BaseForm[a^2,2] Out[2]//BaseForm= Subscript[0.0110111001, 2] Note that the internal representation of numbers doesn't ...


6

I feel like I should be prefacing this answer with three confessions, considering that this is an arithmetic question. First, I had a hard time with the multiplication tables until I was nine years old. Second, even after I finally got the hang of multiplication, I was never a fan of multiplying from right-to-left; I preferred going left-to-right. (Arthur ...


6

You can enter a number in an arbitrary base using base^^digits: alpha = 2^^0.10101; BaseForm[alpha, 2] BaseForm[alpha^2, 2]


3

If you look up the term pure function you'll find that in Mathematica jargon (as e.g. used in documentation) it actually means something that in computer science jargon is typically called an "anonymous" function. In CS jargon a pure function is usually one with no inner state, no side effects and isn't depending on any external input. The right hand side of ...


2

Probably something like this would work: f := (If[AllTrue[{##}, IntegerQ] , +##]) &


1

At the moment, this is just some random thoughts and observations. I will try to morph it into a coherent answer, soon. First, a determinant can be reasonably calculated using LUDecomposition, e.g. Clear[ludet]; ludet[nn_] := ludet[nn] = Block[{u, s1}, u = First@LUDecomposition@Table[s1[i1, i2], {i1, 1, nn}, {i2, 1, nn}]; Times @@ Diagonal[u ...


1

You have quite a small data set, so a really inefficient brute force search will still run pretty fast (<1 sec on my computer). I stress that this is STUPID way to do it, and with list manipulation you can surely make it MUCH more efficient. But as I said - it works. First, transform the data so that you could retrieve the data by calling f[x1,x2,x3], ...



Only top voted, non community-wiki answers of a minimum length are eligible