I assume you want to get as much "XP" as possible, while spending no more than 2566 "points" by "clicking" an integer number of times {n1, n2} on each of two "jobs". Here is the answer in Mathematica:
b <= 4835 ÷ 14, => b <= 345
b <= 2566 ÷ 10, => b <= 256
由于b必须同时低于345和256,所以它必须低于256。
代回:
72 a + 14 × 256 <= 4835, => a <= ( 4835 - 14 × 256 ) ÷ 72, => a <= 17
32 a + 10 × 256 <= 2566, => a <= ( 2566 - 10 × 256 ) ÷ 32, => a <= 0
所以 a = 0,XP 为 2560,使用的点数为 3584。
或者,您可以求解两个不等式的最接近满足,
72 a + 14 b <= 4835 (1)
32 a + 10 b <= 2566 (2)
b <= ( 2566 - 32 a ) ÷ 10 (3) rearrange 2
72 a <= 4835 - 1.4 ( 2566 - 32 a ) (4) subst 3 into 1
27.2 a <= 1242.6
a <= 45.68
因此选择 a = 45 作为最大整数解,给出 b = 112,XP 为 4808,使用的点数为 2560
Let a be the number of Job 1 and b the number of Job 2.
XP = 72 a + 14 b
P = 32 a + 10 b
You appear to want to solve for a and b, such that XP <= 4835, P <= 2566 and b is as large as possible.
72 a + 14 b <= 4835
32 a + 10 b <= 2566
b will be largest when a = 0, i.e.
b <= 4835 ÷ 14, => b <= 345
b <= 2566 ÷ 10, => b <= 256
As b must be both below 345 and 256, it must be below 256.
Substitute back in:
72 a + 14 × 256 <= 4835, => a <= ( 4835 - 14 × 256 ) ÷ 72, => a <= 17
32 a + 10 × 256 <= 2566, => a <= ( 2566 - 10 × 256 ) ÷ 32, => a <= 0
so a = 0, XP is 2560 and points used is 3584.
Alternatively, you can solve for the closest satisfaction of the two inequalities
72 a + 14 b <= 4835 (1)
32 a + 10 b <= 2566 (2)
b <= ( 2566 - 32 a ) ÷ 10 (3) rearrange 2
72 a <= 4835 - 1.4 ( 2566 - 32 a ) (4) subst 3 into 1
27.2 a <= 1242.6
a <= 45.68
so choose a = 45 as the largest integer solution, giving b = 112, XP is 4808, points used is 2560
For either of these, there's no computer programming required; if the constants associated with the two jobs change, then the formulas change.
For harder to solve examples, the relevant area of mathematics is called linear programming
发布评论
评论(3)
令 job1 为 job1 的数量,job2 为 job2 的数量。我们剩下两个方程和两个未知数:
因此:
给定 job1 作为较高的 xp/point 比率,并且您想要超过 4835 xp,将 job1 向上舍入,计算 job2 并将其向下舍入。
检查:
完成。
两个未知数很难说是“新的数学突破”:)
Let job1 be the amount of job1 and job2 be the amount of job2. We are left with two equations and two unknowns:
So:
Given job1 as the higher xp/point ratio and you wanna go over 4835 xp, round job1 up, compute job2 and round it down.
Check:
Done.
Two unknowns is hardly a 'new mathematical breakthrough' :)
我假设您希望获得尽可能多的“XP”,同时通过在两个“工作”中的每一个上“点击”整数次
{n1, n2}
来花费不超过 2566 个“点” ”。 Mathematica 中的答案如下:或者,也许您需要恰好花费 2566 点?那么你能做的最好的就是:
这是你想要的吗?
I assume you want to get as much "XP" as possible, while spending no more than 2566 "points" by "clicking" an integer number of times
{n1, n2}
on each of two "jobs". Here is the answer in Mathematica:Or, maybe you need to spend exactly 2566 points? Then the best you can do is:
Is this what you wanted?
令
a
为作业 1 的编号,b
为作业 2 的编号。您似乎想要求解
a
和b
,使得XP <= 4835
、P <= 2566
和b
尽可能大。当
a = 0
时,b
将是最大的,即由于
b
必须同时低于345和256,所以它必须低于256。代回:
所以 a = 0,XP 为 2560,使用的点数为 3584。
或者,您可以求解两个不等式的最接近满足,
因此选择
a = 45
作为最大整数解,给出b = 112,XP 为 4808,使用的点数为 2560
对于其中任何一个,都不需要计算机编程;如果与两个作业相关的常量发生变化,则公式也会发生变化。
对于较难解决的示例,相关的数学领域称为线性规划
Let
a
be the number of Job 1 andb
the number of Job 2.You appear to want to solve for
a
andb
, such thatXP <= 4835
,P <= 2566
andb
is as large as possible.b
will be largest whena = 0
, i.e.As
b
must be both below 345 and 256, it must be below 256.Substitute back in:
so a = 0, XP is 2560 and points used is 3584.
Alternatively, you can solve for the closest satisfaction of the two inequalities
so choose
a = 45
as the largest integer solution, givingb = 112
, XP is 4808, points used is 2560For either of these, there's no computer programming required; if the constants associated with the two jobs change, then the formulas change.
For harder to solve examples, the relevant area of mathematics is called linear programming