Skip to content
CalcGospel 國際數學圖譜
返回

IAL 2022 June D1 Q1

A Level / Edexcel / D1

IAL 2022 June Paper · Question 1

题目

Problem

The numbers in the list below represent the weights, in kilograms, of ten crates. The crates are to be transported in trucks that can each hold a maximum total crate weight of 300 kg.

175135210105100150602070125175 \quad 135 \quad 210 \quad 105 \quad 100 \quad 150 \quad 60 \quad 20 \quad 70 \quad 125

(a) Calculate a lower bound for the number of trucks that will be needed to transport the crates.

(2)

(b) Using the list provided, carry out a bubble sort to produce a list of the weights in descending order. You need only give the state of the list after each pass.

(4)

(c) Use the first-fit decreasing bin packing algorithm to allocate the crates to the trucks.

(3)
题目中文翻译

下面列表中的数字代表十个板条箱的重量(单位:千克)。板条箱将用卡车运输,每辆卡车最多可容纳总板条箱重量为 300 kg。

175135210105100150602070125175 \quad 135 \quad 210 \quad 105 \quad 100 \quad 150 \quad 60 \quad 20 \quad 70 \quad 125

(a) 计算运输板条箱所需卡车数量的下界。

(b) 使用提供的列表,执行冒泡排序以产生降序的重量列表。只需给出每次传递结束后的列表状态。

(c) 使用首次适应递减装箱算法将板条箱分配给卡车。

解答

(a)

解法一

思路

展开

先求十个板条箱的总重量,再除以每辆卡车的最大载重。由于卡车数量必须是整数,所得商要向上取整;只写整数 4 而不展示这个计算,并不能充分说明下界的来源。

答题过程

展开

The total weight of the crates is

175+135+210+105+100+150+60+20+70+125=1150 kg.175+135+210+105+100+150+60+20+70+125=1150\text{ kg}.

Hence

1150300=3.833\frac{1150}{300}=3.833\ldots

Therefore the lower bound for the number of trucks is

4.\boxed{4}.

(b)

解法一

思路

展开

按照降序冒泡排序的比较方向逐趟扫描,相邻两数顺序不合要求时交换。题目只要求每一趟结束后的列表;即使第五趟已经得到有序列表,仍要再做一趟并写出没有发生交换的结果,才能确认排序结束。

答题过程

展开

The states of the list after successive passes are:

PassState of list
1175, 210, 135, 105, 150, 100, 60, 70, 125, 20175,\ 210,\ 135,\ 105,\ 150,\ 100,\ 60,\ 70,\ 125,\ 20
2210, 175, 135, 150, 105, 100, 70, 125, 60, 20210,\ 175,\ 135,\ 150,\ 105,\ 100,\ 70,\ 125,\ 60,\ 20
3210, 175, 150, 135, 105, 100, 125, 70, 60, 20210,\ 175,\ 150,\ 135,\ 105,\ 100,\ 125,\ 70,\ 60,\ 20
4210, 175, 150, 135, 105, 125, 100, 70, 60, 20210,\ 175,\ 150,\ 135,\ 105,\ 125,\ 100,\ 70,\ 60,\ 20
5210, 175, 150, 135, 125, 105, 100, 70, 60, 20210,\ 175,\ 150,\ 135,\ 125,\ 105,\ 100,\ 70,\ 60,\ 20
6210, 175, 150, 135, 125, 105, 100, 70, 60, 20210,\ 175,\ 150,\ 135,\ 125,\ 105,\ 100,\ 70,\ 60,\ 20

There are no swaps in pass 6, so the sort is complete.

(c)

解法一

思路

展开

使用 (b) 的降序列表依次放置板条箱。每次都从第一辆卡车开始检查,把当前板条箱放入第一辆仍有足够剩余容量的卡车;只有现有卡车都放不下时才启用新卡车。

答题过程

展开

Applying first-fit decreasing to

210, 175, 150, 135, 125, 105, 100, 70, 60, 20,210,\ 175,\ 150,\ 135,\ 125,\ 105,\ 100,\ 70,\ 60,\ 20,

gives

TruckCrates (kg)Total (kg)
1210, 70, 20210,\ 70,\ 20300
2175, 125175,\ 125300
3150, 135150,\ 135285
4105, 100, 60105,\ 100,\ 60265

Thus the crates are allocated to 4 trucks\boxed{4\text{ trucks}}.