Functions with x in different base.

  • Context: Undergrad 
  • Thread starter Thread starter heartless
  • Start date Start date
  • Tags Tags
    Base Functions
Click For Summary

Discussion Overview

The discussion revolves around how to work with functions in different numeral bases, specifically focusing on logarithmic functions and their representation in software like Mathematica. Participants explore the implications of changing numeral systems on function input and output, as well as how to graph these functions while considering different bases.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • Some participants inquire about how to define functions like f(x) in bases other than 10, specifically base 7, and how to input these into Mathematica.
  • It is suggested that changing the numeral system does not alter the function itself, only the representation of numbers.
  • One participant requests examples of functions and their input in Mathematica, emphasizing the need for clarity in graphing functions in different bases.
  • Another participant asserts that functions do not have bases, only the numeral representations do, and thus the graph of a function remains the same regardless of the base used for input.
  • There is a discussion about the potential confusion arising from different bases yielding the same y-values for different x-values in logarithmic functions.
  • Participants express uncertainty about how to prompt Mathematica to display numbers in different bases on graphs, suggesting that the base of a logarithm and the base of numeral representation are distinct concepts.
  • One participant raises a concern about defining functions in Mathematica that require base-specific inputs, noting that the software assumes decimal input for functions.
  • Another participant clarifies that while functions themselves do not care about bases, the representation of numbers does affect how they are inputted into Mathematica.

Areas of Agreement / Disagreement

Participants generally agree that the base of a numeral system does not change the function itself, but there is disagreement regarding how this affects graphing and input in Mathematica. The discussion remains unresolved on how to effectively handle base-specific inputs in function definitions.

Contextual Notes

There are limitations in the discussion regarding the assumptions about how functions are defined in Mathematica and the implications of base representation on mathematical operations. Participants do not reach a consensus on the best approach to graphing or defining functions with base-specific inputs.

heartless
Messages
220
Reaction score
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
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.
 
Thanks, and can you show my some examples of such functions, and possible input into mathematica?
 
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
 
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
 
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
 
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.
 
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.
 
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
 

Similar threads

Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K