Skip to main content
added 85 characters in body
Source Link
RGS
  • 14.1k
  • 1
  • 57
  • 116

Jelly, 54 (5?) bytes

Monadic link taking the list as input.

I<ṖẸ

If I am allowed to output 0 for Truthy and 1 for Falsy... Otherwise,

I<ṖẸ¬

You can try all test cases!

Notice that \$x_{i+1} \geq 2x_i \iff x_{i+1} - x_i \geq x_i\$.

 <      Compare
I       the forward differences
  Ṗ     with the original list without the last item.
   Ẹ    Check if any comparison returned true
    ¬   and negate that

Jelly, 6 bytes

We can instead take pairwise quotients and check directly if they satisfy the inequality with this monadic link:

÷Ɲ>.Ẹ¬

You can verify all test cases!

÷Ɲ      Compute the quotient for all pairs of elements in the input list.
  >.    See if the elements are greater than 0.5
    Ẹ   and take the "OR" of that list,
     ¬  finishing off with the negation of that.

Jelly, 5 bytes

Monadic link taking the list as input.

I<ṖẸ¬

You can try all test cases!

Notice that \$x_{i+1} \geq 2x_i \iff x_{i+1} - x_i \geq x_i\$.

 <      Compare
I       the forward differences
  Ṗ     with the original list without the last item.
   Ẹ    Check if any comparison returned true
    ¬   and negate that

Jelly, 6 bytes

We can instead take pairwise quotients and check directly if they satisfy the inequality with this monadic link:

÷Ɲ>.Ẹ¬

You can verify all test cases!

÷Ɲ      Compute the quotient for all pairs of elements in the input list.
  >.    See if the elements are greater than 0.5
    Ẹ   and take the "OR" of that list,
     ¬  finishing off with the negation of that.

Jelly, 4 (5?) bytes

Monadic link taking the list as input.

I<ṖẸ

If I am allowed to output 0 for Truthy and 1 for Falsy... Otherwise,

I<ṖẸ¬

You can try all test cases!

Notice that \$x_{i+1} \geq 2x_i \iff x_{i+1} - x_i \geq x_i\$.

 <      Compare
I       the forward differences
  Ṗ     with the original list without the last item.
   Ẹ    Check if any comparison returned true
    ¬   and negate that

Jelly, 6 bytes

We can instead take pairwise quotients and check directly if they satisfy the inequality with this monadic link:

÷Ɲ>.Ẹ¬

You can verify all test cases!

÷Ɲ      Compute the quotient for all pairs of elements in the input list.
  >.    See if the elements are greater than 0.5
    Ẹ   and take the "OR" of that list,
     ¬  finishing off with the negation of that.
added 274 characters in body; added 293 characters in body
Source Link
RGS
  • 14.1k
  • 1
  • 57
  • 116

Jelly, 5 bytes

Monadic link taking the list as input.

I<ṖẸ¬

You can try all test cases!

Notice that \$x_{i+1} \geq 2x_i \iff x_{i+1} - x_i \geq x_i\$.

 <      Compare
I       the forward differences
  Ṗ     with the original list without the last item.
   Ẹ    Check if any comparison returned true
    ¬   and negate that

Jelly, 6 bytes

We can instead take pairwise quotients and check directly if they satisfy the inequality with this monadic link:

÷Ɲ>.Ẹ¬

You can verify all test cases!

÷Ɲ      Compute the quotient for all pairs of elements in the input list.
  >.    See if the elements are greater than 0.5
    Ẹ   and take the "OR" of that list,
     ¬  finishing off with the negation of that.

Jelly, 5 bytes

I<ṖẸ¬

You can try all test cases!

Notice that \$x_{i+1} \geq 2x_i \iff x_{i+1} - x_i \geq x_i\$.

 <      Compare
I       the forward differences
  Ṗ     with the original list without the last item.
   Ẹ    Check if any comparison returned true
    ¬   and negate that

Jelly, 5 bytes

Monadic link taking the list as input.

I<ṖẸ¬

You can try all test cases!

Notice that \$x_{i+1} \geq 2x_i \iff x_{i+1} - x_i \geq x_i\$.

 <      Compare
I       the forward differences
  Ṗ     with the original list without the last item.
   Ẹ    Check if any comparison returned true
    ¬   and negate that

Jelly, 6 bytes

We can instead take pairwise quotients and check directly if they satisfy the inequality with this monadic link:

÷Ɲ>.Ẹ¬

You can verify all test cases!

÷Ɲ      Compute the quotient for all pairs of elements in the input list.
  >.    See if the elements are greater than 0.5
    Ẹ   and take the "OR" of that list,
     ¬  finishing off with the negation of that.
added 162 characters in body
Source Link
RGS
  • 14.1k
  • 1
  • 57
  • 116

Jelly, 5 bytes

I<ṖẸ¬

You can try all test cases!

Notice that \$x_{i+1} \geq 2x_i \iff x_{i+1} - x_i \geq x_i\$.

 <      Compare
I ṖẸ¬      the forward differences
  Ṗ     with the original list without the last item.
   Ẹ    Check if any comparison returned true
    ¬   and negate that

Jelly, 5 bytes

I<ṖẸ¬

You can try all test cases!

Notice that \$x_{i+1} \geq 2x_i \iff x_{i+1} - x_i \geq x_i\$.

 <      Compare
I ṖẸ¬

Jelly, 5 bytes

I<ṖẸ¬

You can try all test cases!

Notice that \$x_{i+1} \geq 2x_i \iff x_{i+1} - x_i \geq x_i\$.

 <      Compare
I       the forward differences
  Ṗ     with the original list without the last item.
   Ẹ    Check if any comparison returned true
    ¬   and negate that
added 94 characters in body; added 1 character in body; edited body
Source Link
RGS
  • 14.1k
  • 1
  • 57
  • 116
Loading
Source Link
RGS
  • 14.1k
  • 1
  • 57
  • 116
Loading