Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8554179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:49:19+00:00 2026-06-11T14:49:19+00:00

I have an array which has BIG numbers and small numbers in it. I

  • 0

I have an array which has BIG numbers and small numbers in it. I got it from after running a log from WireShark.

This is how the Array look like (for bytes send) :

@Array=qw(10912980
10924534
10913356
10910304
10920426
10900658
10911266
10912088
10928972
10914718
10920770
10897774
10934258
10882186
10874126
8531
8217
3876
8147
8019
68157
3432
3350
3338
3280
3280
7845
7869
3072
3002
2828
8397
1328
1280
1240
1194
1193
1192
1194
6440
1148
1218
4236
1161
1100
1102
1148
1172
6305
1010
5437
3534
4623
4669
3617
4234
959
1121
1121
1075
3122
3076
1020
3030
628
2938
2938
1611
1611
1541
1541
1541
1541
1541
1541
1541
1541
1541
1541
1541
1541
583
370
178)

When you look at these this array carefully, one thing is obvious to the human eye. There are really BIG numbers and small numbers. I want to split the array to two different arrays. That would require me to set a threshold. Array 1 should be ONLY the BIG numbers (10924534-10874126), and array 2 should be the smaller numbers (68157-178). Btw, the array is not sorted. User will NOT input the threshold, and hence should be determined smartly.

Can you help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:49:20+00:00Added an answer on June 11, 2026 at 2:49 pm

    Fast and ugly solution :

    # threshold
    my $t = 0;
    $t += log $_ foreach @Array;
    $t = exp ($t / @Array);
    print "My threshold=$t\n";
    
    my @hi = grep { $_ >  $t } @Array;
    my @lo = grep { $_ <= $t } @Array;
    

    With you data, the chosen threshold is 10017, which is far better than the mean or median in your case !!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array which has many values in it . I just wanted
I have an array which has the contents as the result of an sql
I have created 4 buttons via Interface Builder. I have an array which has
I have an int array which has no elements and I'm trying to check
I have an array Items which has 10 elements. I need to remove the
I have an array called: $fragment = array($fragment); Which has the following three values:
I have a C++ code which has 3 array declarations. float A[NUM]; float B[NUM];
I have a file test.txt which has an array: array = [3,5,6,7,9,6,4,3,2,1,3,4,5,6,7,8,5,3,3,44,5,6,6,7] Now what
I'm using ASP.NET MVC and have a model which has an image (byte array)
I have a Big string which has multiple mathmls in it. Want to take

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.