1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Is ASCII table a function?

  1. Aug 26, 2015 #1
    1. The problem statement, all variables and given/known data
    One of the problem in my homework is a question that ask is ASCII table (https://en.wikipedia.org/wiki/ASCII) a function and require me to answer mathematically which i don't know how.

    2. Relevant equations


    3. The attempt at a solution
    I think ASCII table is not a function because if we get the decimal numbers to be the domain, it won't be a function since it's not assigned exactly one output since a particular decimal number have equivalents in hex and char. I want to do a vertical line test but i don't know how to graph it
     
  2. jcsd
  3. Aug 26, 2015 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    Decimal and hexadecimal representations of a particular integer have nothing to do with whether something is a function. Each form is a different representation of the same number. There's nothing in the definition of a function which says that f(x) = x2 must use only decimal notation for the input and output.

    Code (Text):

     --------- x ---------   -------- f(x) ---------
     (decimal)     (hex)     (decimal)      (hex)
         0            0          0            0
         1            1          1            1
         2            2          4            4
         4            4         16           10
        10            A        100           64
     
     
  4. Aug 26, 2015 #3

    RUber

    User Avatar
    Homework Helper

    So what is the definition of a function?
    For any single input, there is a unique output. That output might be multiple columns.
    Domain of x might be decimal, and the range of x might be the entire row where x is found.
    input (x) --> output [ bin(x), hex(x), x, oct(x), glyph(x)]
    or, it could simply be input decimal and output glyph.
    The question is, for any x, could there be two outputs? which is different from one output with two (or more) entries.
     
  5. Aug 27, 2015 #4

    Thanks for the reply! sorry for the late response, so ASCII table can be a function with the output consisting of multiple column, now i have to define the function by interval notation. I need help though, as i only able to define function that are very simple.
     
  6. Aug 27, 2015 #5

    RUber

    User Avatar
    Homework Helper

    This is a pretty simple function. Give it a value in one format, it returns the same value in a different format.
    What is "interval notation"? Is that defining the domain and range?
    First you have to decide what your function does. Is it a function that takes a decimal value and translates it to just one column? Is the column to translate into an additional input variable? Does the function return an entire row?

    The table on its own cannot be called a function since there is no sense of what you are putting in or getting out.
     
  7. Aug 27, 2015 #6



    No i was mistaken, what i meant is defining the function like this
    Let D = {1, 2, 3}
    Let C = {X | X ∈ ℕ+}
    F ∶ D → C= f(x)= 4- x

    Define the function formally or mathematically my lecturer said.

    Does it make sense if i create a group of functions where each returns 1 output for every input? (i build a group of function with an input of decimal, each returning hexa,char and so on) or would it make more sense to make a single function where the output returns and entire row?
     
  8. Aug 27, 2015 #7

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    The hexadecimal equivalent for the input is furnished purely as a courtesy to the computer types, so they can easily decode the input value in terms of binary digits (1's and 0's)

    In the ASCII table shown in the Wiki article, they don't even bother with hex, but the table is based on the ASCII code written using 7 bits (a bit is a binary digit).

    In other words, forget about the hex.
     
  9. Aug 27, 2015 #8

    SammyS

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Gold Member

    Please state the entire question as it was given to you.

    As RUber pointed out, it's absolutely important that it's clear as to what is the output of this relation which you are working with.

    What is the domain and what is the co-domain?
     
  10. Aug 27, 2015 #9
    81910.jpg
     
  11. Aug 27, 2015 #10

    SammyS

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Gold Member

    Perhaps your rule of correspondence is supposed to take you from some number (whether it's in decimal or hex or binary or octal or whatever base) to an ordered pair consisting of a row number and a column number .
     
  12. Aug 27, 2015 #11
    Can you give an example, i don't quite get it
     
  13. Aug 27, 2015 #12

    SammyS

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Gold Member

    For instance:The function (if it is a function) maps the number (0101001)2 to the 10th row and 3rd column of the table of characters which contains the character " ) " ,the right parenthesis .
     
  14. Aug 27, 2015 #13

    RUber

    User Avatar
    Homework Helper

    I would infer that the input is the binary, however you might know how to define that set from (0000000) to (1111111), and the output would be the set of 128 unique values in the table. As SammyS said, it might be easier to define a functional relationship it you define the table value by the (row, column) they are in.
     
  15. Aug 28, 2015 #14

    RUber

    User Avatar
    Homework Helper

    Have you made any progress on this problem?

    you might define spaces like ##\mathbb{Z}^{0,127}_{B7}:## the 7 digit binary set of integers from 0 to 127,
    ##\mathbb{Z}^{0,15}:## the set of integers from 0 to 15, and ##\mathbb{Z}^{0,7}:## the set of integers from 0 to 7.
    Then your notation might look something like ##f:\mathbb{Z}^{0,127}_{B7}\to \mathbb{Z}^{0,15}\times \mathbb{Z}^{0,7}##
    However, it seems like the question is asking you to write out the mathematical function to go from a binary input to an ordered pair output. Can you define that function?

    You might find it convenient to be able to refer to your individual digits, ##( b_6, b_5, b_4, b_3, b_2, b_1, b_0) ##.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Is ASCII table a function?
  1. Table tournament (Replies: 3)

  2. Truth table (Replies: 1)

Loading...