Functions with x in different base.

In summary, changing the numeral system does not change the function itself. It only affects how numbers are displayed. Functions do not have bases, only the place-notation representations of numbers do. In Mathematica, use the notation B^^xxxxx to enter numbers in bases other than 10 and use BaseForm[] to display numbers in other bases. When graphing functions, the same graph is drawn regardless of the base used for the inputs. The base of a logarithm and the base of numeral representation are not the same thing, and functions in Mathematica assume decimal inputs. To use different bases in a function, the input must be converted to a string.
  • #1
heartless
220
2
How can I do functions in different bases, other than 10?
Like for example, f(x) where x is in base 7.
I'd also like to know how to input such functions into mathematica
For example let's say, f(x) = log x but x must be only in base 7.
Thanks,
 
Mathematics news on Phys.org
  • #2
heartless said:
How can I do functions in different bases, other than 10?
Like for example, f(x) where x is in base 7.
I'd also like to know how to input such functions into mathematica
For example let's say, f(x) = log x but x must be only in base 7.
Thanks,
Just because you are changing the numeral system does not mean you are changing the function.

The function is exactly the same, the only difference is how you display numbers.
 
  • #3
Thanks, and can you show my some examples of such functions, and possible input into mathematica?
 
  • #4
The functions wouldn't be input into Mathematica any differently. All you'd do is express the inputs and final answers in a different base.

Functions don't have bases; only the place-notation representations of numbers have bases.

- Warren
 
  • #5
In Mathematica, use the notation B^^xxxxx to enter numbers in bases other than 10.

For example, enter

2^^100000000

to enter 256 in base 2.

To display a number in another base, use BaseForm[], like this:

BaseForm[256, 2]

- Warren
 
  • #6
thanks chroot, that is pretty obvious. Can you also show me
how to graph f(x)=log x where both x's are in base 7 (actually can be any base except for 10)?
I'd really appreciate
 
  • #7
heartless said:
thanks chroot, that is pretty obvious. Can you also show me
how to graph f(x)=log x where both x's are in base 7 (actually can be any base except for 10)?
I'd really appreciate
You seem to be missing the point.

You graph the function f(x) = log x independently of what numeral system you are working in. The only difference is if you were to put numbers on the graph, they would just look different, but they would still be the same numbers.

So in your case with f(x) = log x, you draw exactly the same graph, except where you might have put the number 7 on the graph, you replace it with 10. But they are still the equivalent number, they just look different.
 
  • #8
heartless said:
thanks chroot, that is pretty obvious. Can you also show me
how to graph f(x)=log x where both x's are in base 7 (actually can be any base except for 10)?
I'd really appreciate
Would using the Roman symbols for numbers (ie I, II, III, IV, V, VI, VII etc) mean you plot the graph y = log(x) differently? No, of course not. Writing numbers in a different base is exactly the same principle, you're just writing them down in a different way, not changing them.
 
  • #9
I'm probably being mighty stupid here but let's say I do a plot of log2(x)
so using x as the argument, when x is 2, y is 1...when x is 4, y=2, and so on...
now let's try base 10...
using x as the argument, when x is 10, y is 1...when x is 100, y=2, and so on...

such that the same y's are obtained from different x's...ie; two different graphs.

I really don't want to question the wisdom of far wiser and intelligent people but the idea that for any base the function loga(x) yields the same graph would confuse the hell out of me!

I suspect that what heartless really wants to know (but didn't ask for it properly)... is how to construct graphs in mathematica using the same argument 'x' to different bases such that x maps to y differently, not how to express the argument x in base a or base b etc...I cannot offer any suggestions with that though.

(apologies if my terminology is incorrect in places)
 
Last edited:
  • #10
The "base" of a logarithm and the "base" of numeral representation are not the same thing, GregA.

- Warren
 
  • #11
ok, thanks. Let me ask you the very last question. How can I prompt mathematica to display numbers in different bases on the graph? For example normally it would count numbers consecutively 1...8, 9, 10, 11... and so on,
but I'd like it to graph it the way given base goes, for example, 1...6, 10, 11 and so on.
 
  • #12
chroot said:
The "base" of a logarithm and the "base" of numeral representation are not the same thing, GregA.

- Warren

I know :wink: ...It just seemed more likely from the posts and replies that heartless wanted to do plots of say log2(x) and log8(x) etc...as opposed to numbering x as 00,01,10,11 etc... or 0,1,2...,7,10,11 etc... I still believe it was worth raising the possibility...even though I was completely wrong! :redface:
 
Last edited:
  • #13
similar question

if you would like to convert a number from binary to decimal, you can say
decimal=2^^binary

but
f[binary_]:=2^^binary will not do this

the function is assuming a decimal input and so things like
binary=5 lead to 2^^5 which doesn't make sense

so i guess in this way, functions (in mathematica) which are representations of functions *do* care about the base
you certainly can't ask it to evaluate Sin[12a5f]

how can we fix this? do we have to resort to making the variables strings etc?
 
  • #14
You can do Sin[16^^12a5f]

- Warren
 
  • #15
warren
Sin[16^^12a5f] works

f[x_]:=Sin[16^^x] does not
 
  • #16
dorky,

I know. The second statement,

f[x_]:=Sin[16^^x]

makes no sense. The sine function doesn't care at all what base you use to express your numbers. If you declared the function like this:

f[x_]:=Sin[x]

then you could use it with decimal, f[9], or hexadecimal, f[16^^12a5f], or any other base you want.

The point remains: NUMERALS HAVE BASES, NUMBERS AND FUNCTIONS DO NOT.

- Warren
 

1. What is a function with x in a different base?

A function with x in a different base is a mathematical expression that uses a variable x and is written using a non-decimal base, such as binary, hexadecimal, or octal. This allows for calculations to be performed using a different number system than the base 10 system we are used to.

2. How do you convert a function with x in a different base to base 10?

To convert a function with x in a different base to base 10, you can use the following formula: y = a*b^x. Where a is the coefficient, b is the base, and x is the exponent. Simply plug in the values for a, b, and x and solve for y.

3. What are some common uses for functions with x in different bases?

Functions with x in different bases are commonly used in computer programming, cryptography, and digital electronics. They allow for more efficient and accurate calculations in these fields.

4. Can a function with x in a different base be graphed?

Yes, a function with x in a different base can be graphed. The x-axis will represent the input values in the non-decimal base, while the y-axis will represent the output values in base 10. The resulting graph may look different from a traditional base 10 function graph.

5. Are there any special rules for solving equations with functions in different bases?

Yes, there are some special rules for solving equations with functions in different bases. For example, when solving for x, you must make sure to use the correct base throughout the equation. Also, some properties of exponents may not apply when working with non-decimal bases.

Similar threads

Replies
2
Views
1K
Replies
4
Views
895
Replies
1
Views
1K
  • General Math
Replies
13
Views
2K
  • General Math
Replies
5
Views
841
  • General Math
Replies
2
Views
720
Replies
4
Views
407
Replies
2
Views
745
Back
Top