2023.1.16(一)上午 关于人口老龄化的研究——老龄化的式子表示及建国以来的老龄化情况
- 前言
- 定义
- 建模
- 模型细节
- 代码实现
- .in文件
- .out文件
前言
今天研究一个简单一点的问题,预计2023.1.18正式结题做PPT展示。
定义
老龄人: 60岁≤ 的人
老龄化:老年人占比增加
建模
用昨天get到的数据就行了
假设
去年的总人口数:xxx
去年的老龄人口数:yyy
今年相比去年增加老龄人口数:vvv
今年相比去年增加总人口数:uuu
如果老龄化,那vvv和uuu有具体的比例的取值范围
假设今年相比去年老龄化
则:
y/x<(y+v)/(x+u)y/x<(y+v)/(x+u)y/x<(y+v)/(x+u)
y(x+u)<x(y+v)y(x+u)<x(y+v)y(x+u)<x(y+v)
xy+yu<xy+xvxy+yu<xy+xvxy+yu<xy+xv
yu<xvyu<xvyu<xv
u/v<x/yu/v<x/yu/v<x/y
∴这个比率是u/vu/vu/v(右手就行
综上:
若u/v<x/yu/v<x/yu/v<x/y
∴人口老龄化
否则,人口未老龄化
模型细节
- 每年死亡人口平分至各个年龄段,如果某年龄段当年人口不够减,优先减至年龄大的人口数中。
- 1949年前的数据没有get到,所以用1949年总人口分成1-99岁(0岁以给出),死亡人口按1算
代码实现
#include<bits/stdc++.h>
using namespace std;const int maxn=1e5+10;
double b[maxn],d[maxn],tot[maxn],cnt[maxn];
int main(){freopen("old.in","r",stdin); freopen("old.out","w",stdout);//1949年前的数据处理 for(int i=1850;i<=1948;i++)cnt[i]=538.38715; //1949-2021的数据求 for(int i=1949;i<=2021;i++){scanf("%lf%lf",&b[i],&d[i]);//出生和死亡人口 double pr_all=0,pr_old=0;//去年数据统计for(int j=1850;j<i;j++){pr_all+=cnt[j];if(i-j>=59)pr_old+=cnt[j];}//printf("pr = %.5lf %.5lf\n",pr_all,pr_old);double pr=pr_all/pr_old;cnt[i]=b[i];double c=0,u=0;//u指差多少 double add_all=cnt[i]-d[i],add_old=cnt[i-60];//前年的数据for(int j=1850;j<=i-60;j++){if(cnt[j]>0)add_old-=c;}bool flag=false;for(int j=1850;j<=i;j++){//最老人口年龄枚举 if(cnt[j]>0&&!flag){c=d[i]*1.0/(i-j+1);//平均每个年龄的死亡人数计算 flag=true;}//人口死亡人数减少 if(flag){if(cnt[j]>=c+u){cnt[j]=cnt[j]-c-u;u=0;}else{u=c+u-cnt[j];cnt[j]=0;}}}//打印 printf("%d = %.5lf ",i,add_all*1.0/add_old);bool yes=false;;if(add_all*1.0/add_old<pr)yes=true;if(yes)printf("< %.5lf => 老龄化\n",pr);else printf("≥%.5lf => 未老龄化\n",pr);}return 0;
}
.in文件
//出生人口 和 死亡人口
1950.012 1083.34
2042.252 993.528
2128.14 1002.14
2126.834 977.194
2175.452 823.144
2288.30002 794.30588
2003.759 754.7902
2004.2132 716.2392
2200.14159 698.2524
1928.34468 790.60812
1665.38946 980.55013
1381.07802 1683.64401
1194.02367 943.75947
2504.75712 678.34368
3015.8992 698.6372
2773.43066 814.96844
2756.444 689.111
2624.62382 661.18754
2605.67616 646.83696
2807.5905 647.9055
2762.98175 650.20826
2787.70128 634.05888
2619.93946 625.58086
2608.33584 666.90405
2504.15277 631.61388
2266.93205 670.53942
2137.6746 680.2112
1875.27717 683.19693
1807.35522 656.27034
1756.72675 601.61875
1738.19844 605.73582
1797.41805 625.7897
2092.50552 636.45792
2264.85112 670.9164
2079.73152 710.7552
2076.7043 711.71474
2227.10504 717.66978
2411.38201 737.49802
2549.969 734.496
2483.65162 737.21264
2432.15232 737.08416
2407.85298 762.60111
2279.39664 776.0141
2137.19904 778.01544
2143.97253 786.95288
2121.345 777.8265
2073.59152 795.76497
2078.16522 802.87184
2048.48282 804.80526
1951.26204 810.9465
1841.50704 812.57756
1778.20429 817.49235
1707.64926 820.64161
1651.90558 823.38373
1603.70707 827.0528
1597.55252 834.52296
1621.3744 851.22156
1589.20632 895.16088
1598.7609 915.65397
1612.21628 937.58212
1594.7275 944.826
1595.6829 953.38701
1790.33532 963.30024
1980.38354 969.12386
1781.53978 974.85638
1903.64418 980.03952
1658.52874 977.96482
1889.37824 980.19328
1769.73904 988.47766
1526.27526 995.03028
1467.89328 999.74672
1203.12624 998.36884
1062.2752 1014.2468
.out文件
1949 = 1.60976 < 2.41463 => 老龄化
1950 = 1.98790 < 2.44466 => 老龄化
1951 = 2.17493 < 2.48029 => 老龄化
1952 = 2.26355 < 2.52119 => 老龄化
1953 = 2.71327 ≥2.56335 => 未老龄化
1954 = 3.04592 ≥2.60803 => 未老龄化
1955 = 2.58626 < 2.65834 => 老龄化
1956 = 2.70694 ≥2.69660 => 未老龄化
1957 = 3.20157 ≥2.73529 => 未老龄化
1958 = 2.45920 < 2.78298 => 老龄化
1959 = 1.50385 < 2.82085 => 老龄化
1960 = -0.67767 < 2.85134 => 老龄化
1961 = 0.58024 < 2.88268 => 老龄化
1962 = 4.31895 ≥2.89664 => 未老龄化
1963 = 5.55858 ≥2.96458 => 未老龄化
1964 = 4.76799 ≥3.05583 => 未老龄化
1965 = 5.12140 ≥3.14004 => 未老龄化
1966 = 4.93667 ≥3.22161 => 未老龄化
1967 = 4.99610 ≥3.29753 => 未老龄化
1968 = 5.58647 ≥3.37300 => 未老龄化
1969 = 5.54320 ≥3.45799 => 未老龄化
1970 = 5.73191 ≥3.54198 => 未老龄化
1971 = 5.38305 ≥3.62732 => 未老龄化
1972 = 5.31374 ≥3.70605 => 未老龄化
1973 = 5.20238 ≥3.78698 => 未老龄化
1974 = 4.49884 ≥3.86310 => 未老龄化
1975 = 4.17037 ≥3.93203 => 未老龄化
1976 = 3.46452 < 3.99728 => 老龄化
1977 = 3.39851 < 4.05292 => 老龄化
1978 = 3.46280 < 4.10573 => 老龄化
1979 = 3.44305 < 4.15476 => 老龄化
1980 = 3.61332 < 4.20443 => 老龄化
1981 = 4.55762 ≥4.25908 => 未老龄化
1982 = 5.06567 ≥4.32844 => 未老龄化
1983 = 4.42162 ≥4.40896 => 未老龄化
1984 = 4.48559 < 4.48598 => 老龄化
1985 = 5.04771 ≥4.56506 => 未老龄化
1986 = 5.69820 ≥4.65336 => 未老龄化
1987 = 6.29557 ≥4.75370 => 未老龄化
1988 = 6.17005 ≥4.86273 => 未老龄化
1989 = 6.10292 ≥4.97203 => 未老龄化
1990 = 6.03802 ≥5.08216 => 未老龄化
1991 = 5.62909 ≥5.19683 => 未老龄化
1992 = 5.19548 < 5.31064 => 老龄化
1993 = 5.29738 < 5.42205 => 老龄化
1994 = 5.35900 < 5.53876 => 老龄化
1995 = 5.20841 < 5.65775 => 老龄化
1996 = 5.31619 < 5.78108 => 老龄化
1997 = 5.30519 < 5.91042 => 老龄化
1998 = 4.97979 < 6.04389 => 老龄化
1999 = 4.60276 < 6.17906 => 老龄化
2000 = 4.40433 < 6.31496 => 老龄化
2001 = 4.16993 < 6.45462 => 老龄化
2002 = 3.99642 < 6.59777 => 老龄化
2003 = 3.84607 < 6.74549 => 老龄化
2004 = 3.88183 < 6.89876 => 老龄化
2005 = 4.02841 < 7.06106 => 老龄化
2006 = 3.73698 < 7.23666 => 老龄化
2007 = 3.79458 < 7.42939 => 老龄化
2008 = 3.87216 < 7.06642 => 老龄化
2009 = 0.41134 < 6.71257 => 老龄化
2010 = 0.38297 < 6.36918 => 老龄化
2011 = 0.46806 < 6.06307 => 老龄化
2012 = 0.57149 < 5.78464 => 老龄化
2013 = 0.44283 < 5.51673 => 老龄化
2014 = 0.47695 < 5.32698 => 老龄化
2015 = 0.41157 < 5.15692 => 老龄化
2016 = 0.54928 < 4.95594 => 老龄化
2017 = 0.42185 < 4.82475 => 老龄化
2018 = 0.33606 < 4.74011 => 老龄化
2019 = 0.35487 < 4.69543 => 老龄化
2020 = 0.19728 < 4.67787 => 老龄化
2021 = 0.05583 < 4.46046 => 老龄化