Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #12440

Re: Integer Length Count

From daniel.lichtblau0@gmail.com
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Integer Length Count
Date 2012-11-24 07:27 +0000
Message-ID <k8pstl$iqt$1@smc.vnet.net> (permalink)
References <k8nc79$dh1$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


On Friday, November 23, 2012 2:32:54 AM UTC-6, sylvi...@comcast.net wrote:
> I use a function in SAS that takes, in my case, a billion different integ=
ers of varying length and counts the frequency of the length of each intege=
r by converting the digits in the integers into alpha characters and counti=
ng the frequency of the right most position of the alpha character.
>
>
>
>
>
>
>
> I am trying to do more and more routine programming in Mathematica and af=
ter poking around in documentation for the past 4 hours have yet to find th=
e parallel function in Mathematica for counting the integer frequency lengt=
h in a big data set. My family wants me to drop everything and put the Turk=
ey in the oven. My cat Sylvester even fell asleep on his back in front of t=
he refrigerator with his little legs up in the air, so he want miss the tra=
nsfer of the Turkey from the stove to the refrigerator. OH WELL -- IT'S SHO=
W TIME!
>
>
>
>
>
>
>
> Meanwhile, let me know any recommendations you have on a Mathematica func=
tion that parallels the SAS Function.
>
>
>
>
>
>
>
> Sylvia Hobbs

Could take floor of logs base 10 to get the digit counts.

listofintegers =1+10^RandomInteger[{0,12},{100}];

Tally[Map[Floor[Log[10.,#]]&, listofintegers]]

Out[12]= {{6, 8}, {9, 6}, {11, 11}, {12, 8}, {7, 13}, {1, 8}, {8, 8},
  {10, 8}, {2, 7}, {5, 9}, {3, 4}, {0, 5}, {4, 5}}

Daniel Lichtblau
Wolfram Research

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Integer Length Count sylviehobbs@comcast.net - 2012-11-23 08:30 +0000
  Re: Integer Length Count daniel.lichtblau0@gmail.com - 2012-11-24 07:27 +0000
  Re: Integer Length Count Ray Koopman <koopman@sfu.ca> - 2012-11-24 07:28 +0000
  Re: Integer Length Count Helen Read <readhpr@gmail.com> - 2012-11-24 07:41 +0000

csiph-web