All problems
Retrieval Query Expansion Count
Problem
Count queries issued after expansion rounds. Every query active in a round produces expansions_each new queries for the next round, so each round multiplies the active count by (1 + expansions_each).
Return base_queries * (1 + expansions_each) ** rounds, treating negative rounds or expansions as 0.
Hint
Compound the multiplier round by round, or raise it to the number of rounds.
Test cases
case 1
in: [2,3,0]
expected: 2
case 2
in: [2,3,1]
expected: 8
case 3
in: [1,2,2]
expected: 9
case 4
in: [5,0,4]
expected: 5
case 5
in: [0,2,3]
expected: 0
Starter codePython
def retrieval_query_expansion_count(base_queries, expansions_each, rounds):
# Your code here
pass5 test cases · run your code against them in the editor