Skip to main content

Questions tagged [population-count]

use this tag when question involves taking a census or counting things, such as people or objects in a collection

population-count
0 votes
1 answer
31 views

Adding percentage annotations to a graph using python

Ting to add some percentage annotations to a population pyramid, but currently the percentages are duplicated, cannot, for the life of me figure out how to fix it. #creating a count of each male in ...
Leakie's user avatar
  • 1
3 votes
2 answers
269 views

R: Simulating the Population of a Fish Pond

I am working with the R programming language. I came across the following math puzzle recently: Suppose there is a pond with 100 fish Each day, there is a 5% chance that population of the pond ...
stats_noob's user avatar
  • 5,689
2 votes
1 answer
97 views

Question about bit population count Algorithm

POPCNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; POPCNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; POPCNT_MODULO = 0x3F; number of ...
imelon2's user avatar
  • 123
-1 votes
1 answer
335 views

Population Growth in Python

I have an assignment and I can't figure out what is wrong: Write a Python program that calculates population growth. read the initial population read how many generations will be calculated ask if ...
letturatti's user avatar
0 votes
0 answers
38 views

Calculate population size with multiple sub-annual projection matrices

I have a population vector with juveniles and adults that I would like to record new population size after each sub-annual transition. The expected output would have the original population vector on ...
hnguyen's user avatar
  • 804
1 vote
2 answers
2k views

How to calculate how many bits in a decimal number is 1?

This program I created in RISC-V RARS 1.3 application is designed to take a decimal number and count how many bits are in that number. The one I am testing is the decimal number 5, and this program ...
stevenu's user avatar
  • 11
0 votes
1 answer
852 views

How do I remove negative X axis labels in a population pyramid?

I have a population pyramid but the x axis on one side is negative, is there a way to rename just the negative x axis so that it is positive? # Draw Plot plt.figure(figsize=(13,10), dpi= 80) ...
Sanch's user avatar
  • 387
2 votes
1 answer
1k views

What does the Surv error message "start and stop are different lengths" actually mean?

I am analysing a set of lifespan data based on a population of animals (C. elegans) and I'm not sure if I have the data set up incorrectly or I'm using the Surv function incorrectly. I have a table ...
Linda's user avatar
  • 21
9 votes
2 answers
7k views

Counting 1 bits (population count) on large data using AVX-512 or AVX-2

I have a long chunk of memory, say, 256 KiB or longer. I want to count the number of 1 bits in this entire chunk, or in other words: Add up the "population count" values for all bytes. I know that ...
einpoklum's user avatar
  • 127k
-2 votes
1 answer
324 views

Bit scan forward / back and popcount in pure Pascal? Porting from asm versions [closed]

I am porting a Delphi 32bit app to a Pascal Script - which does not support asm, and I only have 64bit machines so I cannot even run the code and mimic it. {$ASMMODE INTEL} function BitScanForward(...
Ozz Nixon's user avatar
  • 161
9 votes
3 answers
25k views

How to enable support for the POPCNT instruction / intrinsic on my computer?

I tried to run the following program in my computer (Fedora 17 32bit). How can I enable my system to support the popcnt instruction for fast population count? #include <stdio.h> #include <...
afancy's user avatar
  • 683